~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/field.cc

  • Committer: Brian Aker
  • Date: 2011-12-19 17:01:31 UTC
  • mto: (2478.1.1 drizzle-build)
  • mto: This revision was merged to the branch mainline in revision 2482.
  • Revision ID: brian@tangent.org-20111219170131-kg394kzsdpebm6g6
Mark all cases where you are using realloc.

Show diffs side-by-side

added added

removed removed

Lines of Context:
131
131
 
132
132
  if (result->field_buffer == NULL)
133
133
  {
134
 
    result->field_buffer= (drizzle_field_t)malloc((*total) + 1);
 
134
    result->field_buffer= (drizzle_field_t)realloc(NULL, (*total) +1);
135
135
    if (result->field_buffer == NULL)
136
136
    {
137
 
      drizzle_set_error(result->con->drizzle, "drizzle_field_buffer", "malloc");
 
137
      drizzle_set_error(result->con->drizzle, __func__, "Failed to allocate.");
138
138
      *ret_ptr= DRIZZLE_RETURN_MEMORY;
139
139
      return NULL;
140
140
    }