~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/result.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:
56
56
 
57
57
  if (result == NULL)
58
58
  {
59
 
    result= new drizzle_result_st;
 
59
    result= new (std::nothrow) drizzle_result_st;
60
60
    if (result == NULL)
61
61
    {
62
 
      drizzle_set_error(con->drizzle, "drizzle_result_create", "malloc");
 
62
      drizzle_set_error(con->drizzle, __func__, "Failed to allocate.");
63
63
      return NULL;
64
64
    }
65
65
 
355
355
      if (row_list == NULL)
356
356
      {
357
357
        drizzle_row_free(result, row);
358
 
        drizzle_set_error(result->con->drizzle, "drizzle_result_buffer",
359
 
                          "realloc");
 
358
        drizzle_set_error(result->con->drizzle, __func__, "Failed to realloc row_list.");
360
359
        return DRIZZLE_RETURN_MEMORY;
361
360
      }
362
361
 
366
365
      if (field_sizes_list == NULL)
367
366
      {
368
367
        drizzle_row_free(result, row);
369
 
        drizzle_set_error(result->con->drizzle, "drizzle_result_buffer",
370
 
                          "realloc");
 
368
        drizzle_set_error(result->con->drizzle, "drizzle_result_buffer", "Failed to realloc field list.");
371
369
        return DRIZZLE_RETURN_MEMORY;
372
370
      }
373
371