diff options
author | michael-grunder <michael.grunder@gmail.com> | 2017-02-15 03:34:26 +0300 |
---|---|---|
committer | michael-grunder <michael.grunder@gmail.com> | 2017-02-15 03:34:26 +0300 |
commit | 162d8820bc6e179419fe5db593ec47122e8d6129 (patch) | |
tree | 39db8ab76e1fcc25cd647bc4afbfb3ed03e020d5 /redis_cluster.c | |
parent | 88d870e0d9c532fb095678271e06c679b0b3fc83 (diff) |
Make sure redisCluster members are all initialized on (re)creation
Fixes #1105
Diffstat (limited to 'redis_cluster.c')
-rw-r--r-- | redis_cluster.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/redis_cluster.c b/redis_cluster.c index a33b4c00..44c5e0e2 100644 --- a/redis_cluster.c +++ b/redis_cluster.c @@ -282,23 +282,19 @@ create_cluster_context(zend_class_entry *class_type TSRMLS_DC) { redisCluster *cluster; // Allocate our actual struct - cluster = emalloc(sizeof(redisCluster)); - memset(cluster, 0, sizeof(redisCluster)); + cluster = ecalloc(1, sizeof(redisCluster)); #else zend_object * create_cluster_context(zend_class_entry *class_type TSRMLS_DC) { redisCluster *cluster; // Allocate our actual struct - cluster = emalloc(sizeof(redisCluster) + sizeof(zval) * (class_type->default_properties_count - 1)); + cluster = ecalloc(1, sizeof(redisCluster) + sizeof(zval) * (class_type->default_properties_count - 1)); #endif // We're not currently subscribed anywhere cluster->subscribed_slot = -1; - // Assume we're up initially - cluster->clusterdown = 0; - // Allocate our RedisSock we'll use to store prefix/serialization flags cluster->flags = ecalloc(1, sizeof(RedisSock)); |