mirror of
https://github.com/fluencelabs/redis
synced 2025-06-18 11:41:20 +00:00
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.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user