From: Andrey Hristov Date: Wed, 17 Mar 2010 11:40:37 +0000 (+0000) Subject: fix valgrind warning introduced with the latest patch. The memory X-Git-Tag: php-5.3.3RC1~384 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3ff193c05e0b0e093ec10c5d7ad2c83e0d5d7354;p=php fix valgrind warning introduced with the latest patch. The memory should be calloc-ed, not malloced, because the code that uses the stmt storage needs that. --- diff --git a/ext/mysqlnd/mysqlnd_ps.c b/ext/mysqlnd/mysqlnd_ps.c index 36ecf4e7d6..101d8c4b89 100644 --- a/ext/mysqlnd/mysqlnd_ps.c +++ b/ext/mysqlnd/mysqlnd_ps.c @@ -2143,7 +2143,7 @@ MYSQLND_CLASS_METHODS_END; MYSQLND_STMT * _mysqlnd_stmt_init(MYSQLND * const conn TSRMLS_DC) { size_t alloc_size = sizeof(MYSQLND_STMT) + mysqlnd_plugin_count() * sizeof(void *); - MYSQLND_STMT * ret = mnd_pemalloc(alloc_size, conn->persistent); + MYSQLND_STMT * ret = mnd_pecalloc(1, alloc_size, conn->persistent); MYSQLND_STMT_DATA * stmt = ret->data = mnd_pecalloc(1, sizeof(MYSQLND_STMT_DATA), conn->persistent); DBG_ENTER("_mysqlnd_stmt_init");