summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--radsecproxy.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/radsecproxy.c b/radsecproxy.c
index 1178273..705b83c 100644
--- a/radsecproxy.c
+++ b/radsecproxy.c
@@ -1830,7 +1830,6 @@ int replyh(struct server *server, unsigned char *buf) {
}
rq = server->requests + i;
- from = rq->from;
pthread_mutex_lock(&server->newrq_mutex);
if (!rq->buf || !rq->tries) {
@@ -1839,12 +1838,6 @@ int replyh(struct server *server, unsigned char *buf) {
return 0;
}
- if (!from) {
- pthread_mutex_unlock(&server->newrq_mutex);
- debug(DBG_INFO, "replyh: client gone, ignoring reply");
- return 0;
- }
-
if (rq->received) {
pthread_mutex_unlock(&server->newrq_mutex);
debug(DBG_INFO, "replyh: already received, ignoring reply");
@@ -1892,6 +1885,13 @@ int replyh(struct server *server, unsigned char *buf) {
return 0;
}
+ from = rq->from;
+ if (!from) {
+ pthread_mutex_unlock(&server->newrq_mutex);
+ debug(DBG_INFO, "replyh: client gone, ignoring reply");
+ return 0;
+ }
+
if (server->conf->rewrite) {
dorewrite(buf, server->conf->rewrite);
len = RADLEN(buf) - 20;