diff options
author | venaas <venaas> | 2008-09-17 12:02:22 +0000 |
---|---|---|
committer | venaas <venaas@e88ac4ed-0b26-0410-9574-a7f39faa03bf> | 2008-09-17 12:02:22 +0000 |
commit | 403fafa13e85fa0e647b81313341cdb7d7aed68e (patch) | |
tree | ace8e26f2d6a4a81065a22c96176a71295d97ee1 /radsecproxy.c | |
parent | 1e46e5030af79fae82a15a4d25f5e09d5a092719 (diff) |
better logging, fixed bug with crash when removing client
git-svn-id: https://svn.testnett.uninett.no/radsecproxy/trunk@387 e88ac4ed-0b26-0410-9574-a7f39faa03bf
Diffstat (limited to 'radsecproxy.c')
-rw-r--r-- | radsecproxy.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/radsecproxy.c b/radsecproxy.c index 2201af9..5775f0c 100644 --- a/radsecproxy.c +++ b/radsecproxy.c @@ -585,20 +585,22 @@ struct client *addclient(struct clsrvconf *conf, uint8_t lock) { } void removeclient(struct client *client) { + struct clsrvconf *conf; + if (!client) return; - - pthread_mutex_lock(client->conf->lock); - if (client->conf->clients) { + conf = client->conf; + pthread_mutex_lock(conf->lock); + if (conf->clients) { pthread_mutex_lock(&client->lock); removequeue(client->replyq); - list_removedata(client->conf->clients, client); + list_removedata(conf->clients, client); pthread_mutex_unlock(&client->lock); pthread_mutex_destroy(&client->lock); free(client->addr); free(client); } - pthread_mutex_unlock(client->conf->lock); + pthread_mutex_unlock(conf->lock); } void removeclientrqs(struct client *client) { |