Merge pull request #436 from dragos-oancea/mod_redis-potential-memleak

[mod_redis] scan-build: Potential leak of memory pointed to by 'cptr' - cr_morebulk()
This commit is contained in:
Andrey Volk
2020-03-06 00:40:57 +04:00
committed by GitHub

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;