summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-03-17 11:40:37 +0000
committerAndrey Hristov <andrey@php.net>2010-03-17 11:40:37 +0000
commit3ff193c05e0b0e093ec10c5d7ad2c83e0d5d7354 (patch)
tree84f8b9d867f82356db2cb571848180fa0a1152d0
parent825d1abdfe0cfa41d020a4de166d8e72164d775e (diff)
downloadphp-git-3ff193c05e0b0e093ec10c5d7ad2c83e0d5d7354.tar.gz
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.
-rw-r--r--ext/mysqlnd/mysqlnd_ps.c2
1 files changed, 1 insertions, 1 deletions
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");