pthread_attr_destroy added to prevent memory leak on config reload

This commit is contained in:
z3APA3A 2017-09-13 22:05:38 +03:00
parent 7f80f4f958
commit e0262c23b0
2 changed files with 4 additions and 0 deletions

View File

@ -153,6 +153,7 @@ int start_proxy_thread(struct child * chp){
pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (16384+conf.stacksize));
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
pthread_create(&thread, &pa, startsrv, (void *)chp);
pthread_attr_destroy(&pa);
#endif
while(conf.threadinit)usleep(SLEEPTIME);
if(haveerror) {

View File

@ -699,6 +699,9 @@ int MODULEMAINFUNC (int argc, char** argv){
pthread_mutex_unlock(&config_mutex);
#endif
#ifndef _WIN32
pthread_attr_destroy(&pa);
#endif
if(defparam.hostname)myfree(defparam.hostname);
if(cbc_string)myfree(cbc_string);
if(cbl_string)myfree(cbl_string);