mirror of
https://github.com/3proxy/3proxy.git
synced 2025-02-24 02:55:40 +08:00
pthread_attr_destroy added to prevent memory leak on config reload
This commit is contained in:
parent
7f80f4f958
commit
e0262c23b0
@ -153,6 +153,7 @@ int start_proxy_thread(struct child * chp){
|
|||||||
pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (16384+conf.stacksize));
|
pthread_attr_setstacksize(&pa,PTHREAD_STACK_MIN + (16384+conf.stacksize));
|
||||||
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
pthread_attr_setdetachstate(&pa,PTHREAD_CREATE_DETACHED);
|
||||||
pthread_create(&thread, &pa, startsrv, (void *)chp);
|
pthread_create(&thread, &pa, startsrv, (void *)chp);
|
||||||
|
pthread_attr_destroy(&pa);
|
||||||
#endif
|
#endif
|
||||||
while(conf.threadinit)usleep(SLEEPTIME);
|
while(conf.threadinit)usleep(SLEEPTIME);
|
||||||
if(haveerror) {
|
if(haveerror) {
|
||||||
|
@ -699,6 +699,9 @@ int MODULEMAINFUNC (int argc, char** argv){
|
|||||||
pthread_mutex_unlock(&config_mutex);
|
pthread_mutex_unlock(&config_mutex);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
pthread_attr_destroy(&pa);
|
||||||
|
#endif
|
||||||
if(defparam.hostname)myfree(defparam.hostname);
|
if(defparam.hostname)myfree(defparam.hostname);
|
||||||
if(cbc_string)myfree(cbc_string);
|
if(cbc_string)myfree(cbc_string);
|
||||||
if(cbl_string)myfree(cbl_string);
|
if(cbl_string)myfree(cbl_string);
|
||||||
|
Loading…
Reference in New Issue
Block a user