~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to libdrizzle/conn.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:
1009
1009
 
1010
1010
  if (con->command_buffer == NULL)
1011
1011
  {
1012
 
    con->command_buffer= (uint8_t*)malloc((*total) + 1);
 
1012
    con->command_buffer= (uint8_t*)realloc(NULL, (*total) +1);
1013
1013
    if (con->command_buffer == NULL)
1014
1014
    {
1015
 
      drizzle_set_error(con->drizzle, "drizzle_command_buffer", "malloc");
 
1015
      drizzle_set_error(con->drizzle, __func__, "Failed to allocate.");
1016
1016
      *ret_ptr= DRIZZLE_RETURN_MEMORY;
1017
1017
      return NULL;
1018
1018
    }