diff options
author | antirez <antirez@gmail.com> | 2013-01-24 11:27:10 +0100 |
---|---|---|
committer | antirez <antirez@gmail.com> | 2013-01-28 13:14:53 +0100 |
commit | 8766e81079dd4e26b0f5e1b04b8fc319b8d13eb7 (patch) | |
tree | 211cee5b22e39d087a6c27c9dc4cad0b86056629 /src/t_list.c | |
parent | 2d20e68fe492b65fcf36af070b9701a9009e57f0 (diff) | |
download | redis-8766e81079dd4e26b0f5e1b04b8fc319b8d13eb7.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); |