Merge pull request #454 from dragos-oancea/mod_redis-nullptr-deref

[mod_redis] scan-build: Dereference of null pointer - cr_delete()
This commit is contained in:
Andrey Volk 2020-02-28 00:35:51 +04:00 committed by GitHub
commit 0594177ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -478,6 +478,7 @@ static int cr_receivereply(REDIS rhnd, char recvtype)
static void cr_delete(REDIS rhnd) static void cr_delete(REDIS rhnd)
{ {
if (!rhnd) return;
if (rhnd->reply.multibulk.bulks != NULL) if (rhnd->reply.multibulk.bulks != NULL)
free(rhnd->reply.multibulk.bulks); free(rhnd->reply.multibulk.bulks);
if (rhnd->reply.multibulk.idxs != NULL) if (rhnd->reply.multibulk.idxs != NULL)