~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to mysys/my_thr_init.cc

  • Committer: Monty Taylor
  • Date: 2009-08-01 01:53:43 UTC
  • mto: (1106.1.4 memory-fix)
  • mto: This revision was merged to the branch mainline in revision 1107.
  • Revision ID: mordred@inaugust.com-20090801015343-zon3inx2npp8luch
Fixed the plugin string valgrind leak.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
 
170
170
bool my_thread_init(void)
171
171
{
172
 
  struct st_my_thread_var *tmp;
173
172
  bool error=0;
 
173
  st_my_thread_var *tmp= NULL;
174
174
 
175
175
#ifdef EXTRA_DEBUG_THREADS
176
176
  fprintf(stderr,"my_thread_init(): thread_id: 0x%lx\n",
185
185
#endif
186
186
    goto end;
187
187
  }
188
 
  if (!(tmp= (struct st_my_thread_var *) calloc(1, sizeof(*tmp))))
 
188
  tmp= static_cast<st_my_thread_var *>(calloc(1, sizeof(*tmp)));
 
189
  if (tmp == NULL)
189
190
  {
190
191
    error= 1;
191
192
    goto end;
246
247
    assert(THR_thread_count != 0);
247
248
    if (--THR_thread_count == 0)
248
249
      pthread_cond_signal(&THR_COND_threads);
249
 
   pthread_mutex_unlock(&THR_LOCK_threads);
 
250
    pthread_mutex_unlock(&THR_LOCK_threads);
 
251
    free(tmp);
250
252
  }
251
253
}
252
254