Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9f865c1

Browse files
Make sure errstr is set before freeing it
1 parent 91b5a37 commit 9f865c1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

library.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1647,7 +1647,7 @@ PHP_REDIS_API int redis_sock_connect(RedisSock *redis_sock TSRMLS_DC)
16471647
efree(host);
16481648

16491649
if (!redis_sock->stream) {
1650-
efree(errstr);
1650+
if (errstr) efree(errstr);
16511651
return -1;
16521652
}
16531653

0 commit comments

Comments
 (0)