diff options
author | antirez <antirez@gmail.com> | 2013-01-24 11:27:10 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-01-28 13:17:26 +0100 |
commit | 2825f21fd80f05865cc977cdcf20d6be159f586f (patch) | |
tree | cc09a2a97d7b5e21e185e092e21d483725173050 /src/t_list.c | |
parent | a64383c8610bee2db6a3089bb9a7c6a39c431481 (diff) | |
download | redis-2825f21fd80f05865cc977cdcf20d6be159f586f.tar.gz |
Fix decrRefCount() prototype from void to robj pointer.
decrRefCount used to get its argument as a void* pointer in order to be
used as destructor where a 'void free_object(void*)' prototype is
expected. However this made simpler to introduce bugs by freeing the
wrong pointer. This commit fixes the argument type and introduces a new
wrapper called decrRefCountVoid() that can be used when the void*
argument is needed.
Diffstat (limited to 'src/t_list.c')
-rw-r--r-- | src/t_list.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/t_list.c b/src/t_list.c index 16b5e1be5..d3d3f6c69 100644 --- a/src/t_list.c +++ b/src/t_list.c @@ -275,7 +275,7 @@ void listTypeConvert(robj *subject, int enc) { if (enc == REDIS_ENCODING_LINKEDLIST) { list *l = listCreate(); - listSetFreeMethod(l,decrRefCount); + listSetFreeMethod(l,decrRefCountVoid); /* listTypeGet returns a robj with incremented refcount */ li = listTypeInitIterator(subject,0,REDIS_TAIL); |