~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzleadmin.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:
118
118
    if (argument)
119
119
    {
120
120
      char *start=argument;
121
 
      free(opt_password);
 
121
      if (opt_password)
 
122
        free(opt_password);
 
123
 
122
124
      opt_password= strdup(argument);
 
125
      if (opt_password == NULL)
 
126
      {
 
127
        fprintf(stderr, _("Memory allocation error while copying password. "
 
128
                          "Aborting.\n"));
 
129
        exit(ENOMEM);
 
130
      }
123
131
      while (*argument) *argument++= 'x';   /* Destroy argument */
124
132
      if (*start)
125
133
        start[1]=0; /* Cut length of argument */