]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_redis] scan-build: Potential leak of memory pointed to by 'cptr' - cr_morebulk() 436/head
authorDragos Oancea <dragos@signalwire.com>
Tue, 25 Feb 2020 22:04:01 +0000 (22:04 +0000)
committerDragos Oancea <dragos@signalwire.com>
Tue, 25 Feb 2020 22:04:01 +0000 (22:04 +0000)
src/mod/applications/mod_redis/credis.c

index 61467f2776bed9d4ba8499a93ca2d85e920db2fd..01432ffe30c4543a2ff9fd712d962a203e0f001d 100644 (file)
@@ -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;