]> granicus.if.org Git - php/commitdiff
fix valgrind warning introduced with the latest patch. The memory
authorAndrey Hristov <andrey@php.net>
Wed, 17 Mar 2010 11:40:37 +0000 (11:40 +0000)
committerAndrey Hristov <andrey@php.net>
Wed, 17 Mar 2010 11:40:37 +0000 (11:40 +0000)
should be calloc-ed, not malloced, because the code that uses the
stmt storage needs that.

ext/mysqlnd/mysqlnd_ps.c

index 36ecf4e7d656d302d61aaa2d8372839e4b02247c..101d8c4b890440349dbb40a3122140047f684804 100644 (file)
@@ -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");