Skip to content

Commit 0c4ddd9

Browse files
remicolletmichael-grunder
authored andcommitted
Fix segfault with igbinary, fix phpredis#341
1 parent 4c1f1bc commit 0c4ddd9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1730,11 +1730,12 @@ redis_unserialize(RedisSock *redis_sock, const char *val, int val_len, zval **re
17301730
#ifdef HAVE_REDIS_IGBINARY
17311731
if(!*return_value) {
17321732
MAKE_STD_ZVAL(*return_value);
1733+
rv_free = 1;
17331734
}
17341735
if(igbinary_unserialize((const uint8_t *)val, (size_t)val_len, return_value TSRMLS_CC) == 0) {
17351736
return 1;
17361737
}
1737-
efree(*return_value);
1738+
if(rv_free==1) efree(*return_value);
17381739
#endif
17391740
return 0;
17401741
break;

0 commit comments

Comments
 (0)