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:
commit
6f24d9b489
|
@ -177,8 +177,10 @@ static int cr_morebulk(cr_multibulk *mb, int size)
|
||||||
|
|
||||||
iptr = realloc(mb->idxs, total * sizeof(int));
|
iptr = realloc(mb->idxs, total * sizeof(int));
|
||||||
|
|
||||||
if (iptr == NULL)
|
if (iptr == NULL) {
|
||||||
|
free(cptr);
|
||||||
return CREDIS_ERR_NOMEM;
|
return CREDIS_ERR_NOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
mb->bulks = cptr;
|
mb->bulks = cptr;
|
||||||
mb->idxs = iptr;
|
mb->idxs = iptr;
|
||||||
|
|
Loading…
Reference in New Issue