From: Alan T. DeKok Date: Thu, 14 Mar 2013 02:01:33 +0000 (-0400) Subject: "this" may be NULL if we don't have a new proxy socket X-Git-Tag: release_3_0_0_beta1~753 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f6a7d24c1805a30d1271a6a28a5b440efab2ed33;p=thirdparty%2Ffreeradius-server.git "this" may be NULL if we don't have a new proxy socket --- diff --git a/src/main/process.c b/src/main/process.c index 05b0c268e5d..d708973bb99 100644 --- a/src/main/process.c +++ b/src/main/process.c @@ -1728,17 +1728,19 @@ static int insert_into_proxy_hash(REQUEST *request) } /* - * Tell the event loop that we have a new FD. It locks - * the socket, so we've got to unlock it here. + * If we have a new socket, tell the event loop. It + * locks the socket, so we've got to unlock it here. */ - PTHREAD_MUTEX_UNLOCK(&proxy_mutex); - if (!event_new_fd(this)) { - listen_free(&this); - return 0; + if (this) { + PTHREAD_MUTEX_UNLOCK(&proxy_mutex); + if (!event_new_fd(this)) { + listen_free(&this); + return 0; + } + PTHREAD_MUTEX_LOCK(&proxy_mutex); } - PTHREAD_MUTEX_LOCK(&proxy_mutex); - request->proxy_listener = this; + request->proxy_listener = proxy_listener; if (!fr_packet_list_insert(proxy_list, &request->proxy)) { fr_packet_list_id_free(proxy_list, request->proxy); PTHREAD_MUTEX_UNLOCK(&proxy_mutex);