Permalink
Browse files

Minor tweaks

  • Loading branch information...
1 parent 053d62d commit 5dda7eb1b8f72c7675ff3fe91e152c93680d3456 @iliaal committed May 18, 2011
Showing with 3 additions and 4 deletions.
  1. +3 −4 redis.c
View
@@ -5098,16 +5098,15 @@ PHP_METHOD(Redis, setOption) {
break;
case REDIS_OPT_PREFIX:
- if(redis_sock->prefix) {
+ if (redis_sock->prefix) {
efree(redis_sock->prefix);
}
- if(val_len == 0) {
+ if (val_len == 0) {
redis_sock->prefix = NULL;
redis_sock->prefix_len = 0;
} else {
redis_sock->prefix_len = val_len;
- redis_sock->prefix = ecalloc(1+val_len, 1);
- memcpy(redis_sock->prefix, val_str, val_len);
+ redis_sock->prefix = estrndup(val_str, val_len);
}
RETURN_TRUE;

0 comments on commit 5dda7eb

Please sign in to comment.