aboutsummaryrefslogtreecommitdiff
path: root/src/protocol
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2017-06-09 18:53:04 -0700
committerGarrett D'Amore <garrett@damore.org>2017-06-09 18:53:04 -0700
commitf81c7e8cc84bd43bfc3cc5e41f773a0078870312 (patch)
treeb27d4b889a84982eef4b31f5a0e8469d70f41211 /src/protocol
parent4cc196e94f129139d8ed0d4d176d12ef76f4c6c5 (diff)
downloadnng-f81c7e8cc84bd43bfc3cc5e41f773a0078870312.tar.gz
nng-f81c7e8cc84bd43bfc3cc5e41f773a0078870312.tar.bz2
nng-f81c7e8cc84bd43bfc3cc5e41f773a0078870312.zip
Don't dereference the psock on an error.
Diffstat (limited to 'src/protocol')
-rw-r--r--src/protocol/survey/respond.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/protocol/survey/respond.c b/src/protocol/survey/respond.c
index 8e36cbb0..3b8c5bd8 100644
--- a/src/protocol/survey/respond.c
+++ b/src/protocol/survey/respond.c
@@ -302,7 +302,7 @@ nni_resp_recv_cb(void *arg)
{
nni_resp_pipe *ppipe = arg;
nni_resp_sock *psock = ppipe->psock;
- nni_msgq *urq = nni_sock_recvq(psock->nsock);
+ nni_msgq *urq;
nni_msg *msg;
uint8_t idbuf[4];
int hops;
@@ -312,6 +312,8 @@ nni_resp_recv_cb(void *arg)
goto error;
}
+ urq = nni_sock_recvq(psock->nsock);
+
NNI_PUT32(idbuf, ppipe->id);
msg = ppipe->aio_recv.a_msg;