From b53274276fc801856b488a48a669e9258d5f8ef6 Mon Sep 17 00:00:00 2001 From: Dragos Oancea Date: Tue, 25 Feb 2020 22:04:01 +0000 Subject: [PATCH] [mod_redis] scan-build: Potential leak of memory pointed to by 'cptr' - cr_morebulk() --- src/mod/applications/mod_redis/credis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mod/applications/mod_redis/credis.c b/src/mod/applications/mod_redis/credis.c index 61467f2776..01432ffe30 100644 --- a/src/mod/applications/mod_redis/credis.c +++ b/src/mod/applications/mod_redis/credis.c @@ -177,8 +177,10 @@ static int cr_morebulk(cr_multibulk *mb, int size) iptr = realloc(mb->idxs, total * sizeof(int)); - if (iptr == NULL) + if (iptr == NULL) { + free(cptr); return CREDIS_ERR_NOMEM; + } mb->bulks = cptr; mb->idxs = iptr;