8000 Bugfix: Forgot to allocate memory for persistent_id · DQPHP/phpredis@bb24d0e · GitHub
[go: up one dir, main page]

Skip to content

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit bb24d0e

Browse files
committed
Bugfix: Forgot to allocate memory for persistent_id
1 parent 7713cc5 commit bb24d0e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

library.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@ PHPAPI void redis_ping_response(INTERNAL_FUNCTION_PARAMETERS, RedisSock *redis_s
755755
*/
756756
PHPAPI RedisSock* redis_sock_create(char *host, int host_len, unsigned short port,
757757
double timeout, int persistent, char *persistent_id,
758-
int persistent_id_len)
758+
int persistent_id_len)
759759
{
760760
RedisSock *redis_sock;
761761

@@ -767,6 +767,7 @@ PHPAPI RedisSock* redis_sock_create(char *host, int host_len, unsigned short por
767767
redis_sock->persistent = persistent;
768768

769769
if (persistent_id) {
770+
redis_sock->persistent_id = ecalloc(persistent_id_len + 1, 1);
770771
memcpy(redis_sock->persistent_id, persistent_id, persistent_id_len);
771772
redis_sock->persistent_id[persistent_id_len] = '\0';
772773
} else {

0 commit comments

Comments
 (0)
0