From 4367732063925abdf8bfb7312fe8ac0c6832af42 Mon Sep 17 00:00:00 2001 From: Linus Nordberg Date: Thu, 6 Oct 2016 16:07:40 +0200 Subject: 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. --- radsecproxy.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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); } -- cgit v1.1