~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleimport.cc

  • Committer: Monty Taylor
  • Date: 2008-12-09 04:10:34 UTC
  • mto: This revision was merged to the branch mainline in revision 670.
  • Revision ID: monty@inaugust.com-20081209041034-2uepslabk0hi3shh
Fixed strdup return checking in client/

Show diffs side-by-side

added added

removed removed

Lines of Context:
189
189
    if (argument)
190
190
    {
191
191
      char *start=argument;
192
 
      free(opt_password);
193
 
      opt_password=strdup(argument);
 
192
      if (opt_password)
 
193
        free(opt_password);
 
194
      opt_password = strdup(argument);
 
195
      if (opt_password == NULL)
 
196
      {
 
197
        fprintf(stderr, "Memory allocation error while copying password. "
 
198
                        "Aborting.\n");
 
199
        exit(ENOMEM);
 
200
      }
194
201
      while (*argument) *argument++= 'x';    /* Destroy argument */
195
202
      if (*start)
196
 
  start[1]=0;        /* Cut length of argument */
 
203
        start[1]=0;        /* Cut length of argument */
197
204
      tty_password= 0;
198
205
    }
199
206
    else