~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/sql_plugin.cc

  • Committer: Monty Taylor
  • Date: 2009-06-08 18:19:53 UTC
  • mto: This revision was merged to the branch mainline in revision 1060.
  • Revision ID: mordred@inaugust.com-20090608181953-9n1u3im0kezu2aoy
Removed copy_and_convert.

Show diffs side-by-side

added added

removed removed

Lines of Context:
285
285
static st_plugin_dl *plugin_dl_add(const LEX_STRING *dl, int report)
286
286
{
287
287
  string dlpath;
288
 
  uint32_t plugin_dir_len, dummy_errors;
 
288
  uint32_t plugin_dir_len;
289
289
  struct st_plugin_dl *tmp, plugin_dl;
290
290
  void *sym;
291
291
  plugin_dir_len= strlen(opt_plugin_dir);
349
349
 
350
350
  /* Duplicate and convert dll name */
351
351
  plugin_dl.dl.length= dl->length * files_charset_info->mbmaxlen + 1;
352
 
  if (! (plugin_dl.dl.str= (char*) malloc(plugin_dl.dl.length)))
 
352
  if (! (plugin_dl.dl.str= (char*) calloc(plugin_dl.dl.length, sizeof(char))))
353
353
  {
354
354
    free_plugin_mem(&plugin_dl);
355
355
    if (report & REPORT_TO_USER)
358
358
      errmsg_printf(ERRMSG_LVL_ERROR, ER(ER_OUTOFMEMORY), plugin_dl.dl.length);
359
359
    return(0);
360
360
  }
361
 
  plugin_dl.dl.length= copy_and_convert(plugin_dl.dl.str, plugin_dl.dl.length,
362
 
    files_charset_info, dl->str, dl->length, system_charset_info,
363
 
    &dummy_errors);
364
 
  plugin_dl.dl.str[plugin_dl.dl.length]= 0;
 
361
  strcpy(plugin_dl.dl.str, dl->str);
365
362
  /* Add this dll to array */
366
363
  if (! (tmp= plugin_dl_insert_or_reuse(&plugin_dl)))
367
364
  {