Test if there is a freeObject function

This commit is contained in:
Pieter Noordhuis 2011-04-21 10:54:15 +02:00
parent eaf58bd32a
commit 26588f5007

View File

@ -585,7 +585,7 @@ void *redisReplyReaderGetObject(void *reader) {
void redisReplyReaderFree(void *reader) { void redisReplyReaderFree(void *reader) {
redisReader *r = reader; redisReader *r = reader;
if (r->reply != NULL && r->fn) if (r->reply != NULL && r->fn && r->fn->freeObject)
r->fn->freeObject(r->reply); r->fn->freeObject(r->reply);
if (r->buf != NULL) if (r->buf != NULL)
sdsfree(r->buf); sdsfree(r->buf);