From 0c4ddd90a6cfb0660cb59fd4521b40d289d6067c Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Fri, 3 Oct 2014 19:19:33 +0200 Subject: [PATCH] Fix segfault with igbinary, fix #341 --- library.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library.c b/library.c index 40d43fa..3e91e93 100644 --- a/library.c +++ b/library.c @@ -1646,11 +1646,12 @@ redis_unserialize(RedisSock *redis_sock, const char *val, int val_len, zval **re #ifdef HAVE_REDIS_IGBINARY if(!*return_value) { MAKE_STD_ZVAL(*return_value); + rv_free = 1; } if(igbinary_unserialize((const uint8_t *)val, (size_t)val_len, return_value TSRMLS_CC) == 0) { return 1; } - efree(*return_value); + if(rv_free==1) efree(*return_value); #endif return 0; break;