zero php_ares on alloc
authorMichael Wallner <mike@php.net>
Fri, 8 Aug 2014 09:34:40 +0000 (11:34 +0200)
committerMichael Wallner <mike@php.net>
Fri, 8 Aug 2014 09:34:40 +0000 (11:34 +0200)
php_ares.c

index 9d5c8096b2d2baadc4d17c7c7df6dd0dd772b37c..252c152520646e544503e1ab319ccf313d40d023 100644 (file)
@@ -1105,7 +1105,7 @@ static PHP_FUNCTION(ares_init)
                RETURN_FALSE;
        }
        
-       ares = emalloc(sizeof(php_ares));
+       ares = ecalloc(1, sizeof(php_ares));
        TSRMLS_SET_CTX(ares->tsrm_ls);
        zend_llist_init(&ares->queries, sizeof(php_ares_query *), (llist_dtor_func_t) php_ares_query_llist_dtor, 0);
        php_ares_options_ctor(&ares->options, opt_array ? Z_ARRVAL_P(opt_array) : NULL);