summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinus Nordberg <linus@nordu.net>2016-10-06 16:07:40 +0200
committerLinus Nordberg <linus@nordu.net>2016-10-06 16:07:40 +0200
commit4367732063925abdf8bfb7312fe8ac0c6832af42 (patch)
treed286539295562ebe480439d3bfa2f8a3b402944e
parentf9a3043a165e600c5d8e0ce0bf14dce0c19afb14 (diff)
Don't follow the NULL pointer.
In practice, sendrq() is called from two functions, radsrv() and clientwr(), none of which should be able to pass rq->to == NULL.
-rw-r--r--radsecproxy.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index e15ac9c..a6f71c4 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -507,7 +507,8 @@ errexit:
if (rq->from)
rmclientrq(rq, rq->msg->id);
freerq(rq);
- pthread_mutex_unlock(&to->newrq_mutex);
+ if (to)
+ pthread_mutex_unlock(&to->newrq_mutex);
removeclientrqs_sendrq_freeserver_lock(0);
}