diff options
author | venaas <venaas> | 2008-06-05 09:11:23 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-06-05 09:11:23 +0000 |
commit | 17df196bbcdb70414383343cf3dc73442e00f256 (patch) | |
tree | 7aedd7f9745a3133b9b22aed77226e02c5545516 | |
parent | ad4a1625a826435f99cc4c7a90012bf5ddddd6a5 (diff) |
removing more state, also had forgotten to detach clientwr thread
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@285 e88ac4ed-0b26-0410-9574-a7f39faa03bf
-rw-r--r-- | radsecproxy.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index 3a74491..f5b420b 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -2440,7 +2440,7 @@ void *clientwr(void *arg) { freeclsrvconf(conf); } freeserver(server, 1); - pthread_exit(NULL); + return NULL; } void *udpserverwr(void *arg) { @@ -2942,7 +2942,7 @@ void adddynamicrealmserver(struct realm *realm, struct clsrvconf *conf, char *id struct clsrvconf *srvconf; struct realm *newrealm = NULL; char *realmname, *s; - + pthread_t clientth; if (!conf->dynamiclookupcommand) return; @@ -2993,17 +2993,21 @@ void adddynamicrealmserver(struct realm *realm, struct clsrvconf *conf, char *id srvconf->servers->dynamiclookuparg = stringcopy(realmname, 0); - if (pthread_create(&srvconf->servers->clientth, NULL, clientwr, (void *)(srvconf->servers))) { + if (pthread_create(&clientth, NULL, clientwr, (void *)(srvconf->servers))) { debug(DBG_ERR, "pthread_create failed"); goto errexit; } - + pthread_detach(clientth); goto exit; errexit: if (newrealm) { list_removedata(realm->subrealms, newrealm); freerealm(newrealm); + if (!list_first(realm->subrealms)) { + list_destroy(realm->subrealms); + realm->subrealms = NULL; + } } freeserver(srvconf->servers, 1); free(srvconf); |