[mod_redis] scan-build: Potential leak of memory pointed to by 'cptr' - cr_morebulk()

This commit is contained in:
Dragos Oancea 2020-02-25 22:04:01 +00:00
parent 42d3100609
commit b53274276f

View 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;