Skip to content

Commit

Permalink
Minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
iliaal committed May 18, 2011
1 parent 053d62d commit 5dda7eb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions redis.c
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -5098,16 +5098,15 @@ PHP_METHOD(Redis, setOption) {
break; break;


case REDIS_OPT_PREFIX: case REDIS_OPT_PREFIX:
if(redis_sock->prefix) { if (redis_sock->prefix) {
efree(redis_sock->prefix); efree(redis_sock->prefix);
} }
if(val_len == 0) { if (val_len == 0) {
redis_sock->prefix = NULL; redis_sock->prefix = NULL;
redis_sock->prefix_len = 0; redis_sock->prefix_len = 0;
} else { } else {
redis_sock->prefix_len = val_len; redis_sock->prefix_len = val_len;
redis_sock->prefix = ecalloc(1+val_len, 1); redis_sock->prefix = estrndup(val_str, val_len);
memcpy(redis_sock->prefix, val_str, val_len);
} }
RETURN_TRUE; RETURN_TRUE;


Expand Down

0 comments on commit 5dda7eb

Please sign in to comment.