From 3ff193c05e0b0e093ec10c5d7ad2c83e0d5d7354 Mon Sep 17 00:00:00 2001 From: Andrey Hristov Date: Wed, 17 Mar 2010 11:40:37 +0000 Subject: [PATCH] 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. --- ext/mysqlnd/mysqlnd_ps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- 2.40.0