mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 08:08:53 -05:00
defensive programming: set o->ptr to NULL before freeing objects
This commit is contained in:
parent
e002ec6801
commit
2f996f0217
@ -179,6 +179,7 @@ void decrRefCount(void *obj) {
|
||||
case REDIS_HASH: freeHashObject(o); break;
|
||||
default: redisPanic("Unknown object type"); break;
|
||||
}
|
||||
o->ptr = NULL; /* defensive programming. We'll see NULL in traces. */
|
||||
if (server.vm_enabled) pthread_mutex_lock(&server.obj_freelist_mutex);
|
||||
if (listLength(server.objfreelist) > REDIS_OBJFREELIST_MAX ||
|
||||
!listAddNodeHead(server.objfreelist,o))
|
||||
|
Loading…
Reference in New Issue
Block a user