From c797bf446e6f1a88e0a575501ab5d6b0f1d1ca8d Mon Sep 17 00:00:00 2001 From: Yao Yue Date: Mon, 25 Jun 2018 12:35:10 -0700 Subject: [PATCH] add condition to check for null pointer in rsp recycling --- src/protocol/data/memcache/response.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/protocol/data/memcache/response.c b/src/protocol/data/memcache/response.c index e4dd16efc..a698b49a0 100644 --- a/src/protocol/data/memcache/response.c +++ b/src/protocol/data/memcache/response.c @@ -163,6 +163,10 @@ response_return_all(struct response **response) struct response *nr, *rsp = *response; + if (rsp == NULL) { + return; + } + nr = STAILQ_NEXT(rsp, next); while (rsp != NULL) { nr = STAILQ_NEXT(rsp, next);