~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Monty Taylor
  • Date: 2008-10-06 01:30:47 UTC
  • Revision ID: monty@inaugust.com-20081006013047-6m2ejc0c4peye2k9
Removed my_free(). It turns out that it had been def'd to ignore the flags passed to it in the second arg anyway. Gotta love that.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1151
1151
          strncmp(link_name, "/dev/null", 10) == 0)
1152
1152
      {
1153
1153
        /* The .drizzle_history file is a symlink to /dev/null, don't use it */
1154
 
        my_free(histfile, MYF(MY_ALLOW_ZERO_PTR));
 
1154
        free(histfile);
1155
1155
        histfile= 0;
1156
1156
      }
1157
1157
    }
1202
1202
    delete glob_buffer;
1203
1203
  if (processed_prompt)
1204
1204
    delete processed_prompt;
1205
 
  my_free(opt_password,MYF(MY_ALLOW_ZERO_PTR));
1206
 
  my_free(opt_drizzle_unix_port,MYF(MY_ALLOW_ZERO_PTR));
1207
 
  my_free(histfile,MYF(MY_ALLOW_ZERO_PTR));
1208
 
  my_free(histfile_tmp,MYF(MY_ALLOW_ZERO_PTR));
1209
 
  my_free(current_db,MYF(MY_ALLOW_ZERO_PTR));
1210
 
  my_free(current_host,MYF(MY_ALLOW_ZERO_PTR));
1211
 
  my_free(current_user,MYF(MY_ALLOW_ZERO_PTR));
1212
 
  my_free(full_username,MYF(MY_ALLOW_ZERO_PTR));
1213
 
  my_free(part_username,MYF(MY_ALLOW_ZERO_PTR));
1214
 
  my_free(default_prompt,MYF(MY_ALLOW_ZERO_PTR));
1215
 
  my_free(current_prompt,MYF(MY_ALLOW_ZERO_PTR));
 
1205
  free(opt_password);
 
1206
  free(opt_drizzle_unix_port);
 
1207
  free(histfile);
 
1208
  free(histfile_tmp);
 
1209
  free(current_db);
 
1210
  free(current_host);
 
1211
  free(current_user);
 
1212
  free(full_username);
 
1213
  free(part_username);
 
1214
  free(default_prompt);
 
1215
  free(current_prompt);
1216
1216
  free_defaults(defaults_argv);
1217
1217
  my_end(my_end_arg);
1218
1218
  exit(status.exit_status);
1565
1565
    if (argument)
1566
1566
    {
1567
1567
      char *start= argument;
1568
 
      my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
 
1568
      free(opt_password);
1569
1569
      opt_password= strdup(argument);
1570
1570
      while (*argument) *argument++= 'x';        // Destroy argument
1571
1571
      if (*start)
1653
1653
  if (argc == 1)
1654
1654
  {
1655
1655
    skip_updates= 0;
1656
 
    my_free(current_db, MYF(MY_ALLOW_ZERO_PTR));
 
1656
    free(current_db);
1657
1657
    current_db= strdup(*argv);
1658
1658
  }
1659
1659
  if (tty_password)
2444
2444
{
2445
2445
  DRIZZLE_RES *res;
2446
2446
 
2447
 
  my_free(current_db, MYF(MY_ALLOW_ZERO_PTR));
 
2447
  free(current_db);
2448
2448
  current_db= NULL;
2449
2449
  /* In case of error below current_db will be NULL */
2450
2450
  if (!drizzle_query(&drizzle, "SELECT DATABASE()") &&
3045
3045
    (void) tee_fputs("\n", PAGER);
3046
3046
  }
3047
3047
  tee_puts(separator.c_str(), PAGER);
3048
 
  my_free(num_flag, MYF(MY_ALLOW_ZERO_PTR));
 
3048
  free(num_flag);
3049
3049
}
3050
3050
 
3051
3051
/**
3449
3449
    tmp= get_arg(buff, 0);
3450
3450
    if (tmp && *tmp)
3451
3451
    {
3452
 
      my_free(current_db, MYF(MY_ALLOW_ZERO_PTR));
 
3452
      free(current_db);
3453
3453
      current_db= strdup(tmp);
3454
3454
      tmp= get_arg(buff, 1);
3455
3455
      if (tmp)
3456
3456
      {
3457
 
        my_free(current_host,MYF(MY_ALLOW_ZERO_PTR));
 
3457
        free(current_host);
3458
3458
        current_host=strdup(tmp);
3459
3459
      }
3460
3460
    }
3633
3633
      if (drizzle_select_db(&drizzle,tmp))
3634
3634
        return put_error(&drizzle);
3635
3635
    }
3636
 
    my_free(current_db,MYF(MY_ALLOW_ZERO_PTR));
 
3636
    free(current_db);
3637
3637
    current_db= strdup(tmp);
3638
3638
    if (select_db > 1)
3639
3639
      build_completion_hash(opt_rehash, 1);
4286
4286
 
4287
4287
static void init_username()
4288
4288
{
4289
 
  my_free(full_username,MYF(MY_ALLOW_ZERO_PTR));
4290
 
  my_free(part_username,MYF(MY_ALLOW_ZERO_PTR));
 
4289
  free(full_username);
 
4290
  free(part_username);
4291
4291
 
4292
4292
  DRIZZLE_RES *result;
4293
4293
  if (!drizzle_query(&drizzle,"select USER()") &&
4305
4305
{
4306
4306
  char *ptr=strchr(line, ' ');
4307
4307
  prompt_counter = 0;
4308
 
  my_free(current_prompt, MYF(MY_ALLOW_ZERO_PTR));
 
4308
  free(current_prompt);
4309
4309
  current_prompt= strdup(ptr ? ptr+1 : default_prompt);
4310
4310
  if (!ptr)
4311
4311
    tee_fprintf(stdout, "Returning to default PROMPT of %s\n",