projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e002ec6
)
defensive programming: set o->ptr to NULL before freeing objects
author
antirez
<antirez@gmail.com>
Thu, 22 Jul 2010 13:48:57 +0000
(15:48 +0200)
committer
antirez
<antirez@gmail.com>
Thu, 22 Jul 2010 13:48:57 +0000
(15:48 +0200)
src/object.c
patch
|
blob
|
blame
|
history
diff --git
a/src/object.c
b/src/object.c
index 7abecfc64600073575b3a4831374a11226355ecf..51582619e12526ca6cec434cd50eee27055f8fe0 100644
(file)
--- a/
src/object.c
+++ b/
src/object.c
@@
-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))