From 1f1f5bdc917acfb0109d1647be35ab9e69344ff4 Mon Sep 17 00:00:00 2001 From: John Sully Date: Sun, 14 Mar 2021 03:22:10 +0000 Subject: [PATCH] Avoid queuing null pointers to be freed Former-commit-id: f50541d437cd1d98139c29407bb3fb4d6ce17fca --- src/snapshot.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/snapshot.cpp b/src/snapshot.cpp index 8a593d4a9..581e2f648 100644 --- a/src/snapshot.cpp +++ b/src/snapshot.cpp @@ -403,7 +403,8 @@ void redisDbPersistentData::endSnapshot(const redisDbPersistentDataSnapshot *psn } // Delete the object from the source dict, we don't use dictDelete to avoid a second search - splazy->vecde.push_back(deSnapshot); + if (deSnapshot != nullptr) + splazy->vecde.push_back(deSnapshot); *dePrev = deSnapshot->next; ht->used--; }