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/?a=commitdiff_plain;h=refs%2Fpull%2F436%2Fhead;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;