svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd_ps.c
| From: | Andrey Hristov | Date: | Wed, 17 Mar 2010 11:40:37 +0000 |
| Subject: | svn: /php/php-src/branches/PHP_5_3/ext/mysqlnd/ mysqlnd_ps.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-62076@lists.php.net to get a copy of this message | ||
andrey Wed, 17 Mar 2010 11:40:37 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=296315
Log:
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.
Changed paths:
U php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
Modified: php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c
===================================================================
--- php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c 2010-03-17 11:39:59 UTC (rev 296314)
+++ php/php-src/branches/PHP_5_3/ext/mysqlnd/mysqlnd_ps.c 2010-03-17 11:40:37 UTC (rev 296315)
@@ -2143,7 +2143,7 @@
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");