From: Dragos Oancea Date: Tue, 25 Feb 2020 22:04:01 +0000 (+0000) Subject: [mod_redis] scan-build: Potential leak of memory pointed to by 'cptr' - cr_morebulk() X-Git-Tag: v1.10.3^2~85^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b53274276fc801856b488a48a669e9258d5f8ef6;p=thirdparty%2Ffreeswitch.git [mod_redis] scan-build: Potential leak of memory pointed to by 'cptr' - cr_morebulk() --- 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;