~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to examples/server.cc

  • Committer: Mark Atwood
  • Date: 2011-06-30 07:03:08 UTC
  • mto: This revision was merged to the branch mainline in revision 2358.
  • Revision ID: me@mark.atwood.name-20110630070308-4380q6dqkkqv92w2
fix cppcheck redundantIfDelete0 warnings.  It is safe to deallocate a NULL pointer

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
  while (1)
233
233
  {
234
234
    drizzle_result_free(result);
235
 
    if (data != NULL)
236
 
      free(data);
 
235
    free(data);
237
236
 
238
237
    data= (uint8_t *)drizzle_con_command_buffer(con, &command, &total, &ret);
239
238
    if (ret == DRIZZLE_RETURN_LOST_CONNECTION ||
240
239
        (ret == DRIZZLE_RETURN_OK && command == DRIZZLE_COMMAND_QUIT))
241
240
    {
242
 
      if (data != NULL)
243
 
        free(data);
 
241
      free(data);
244
242
      return;
245
243
    }
246
244
    DRIZZLE_RETURN_CHECK(ret, "drizzle_con_command_buffer", drizzle)