Author: ahristov
Date: 2007-03-16 14:44:53 +0100 (Fri, 16 Mar 2007)
New Revision: 176
Modified:
trunk/ext/mysqli/mysqli_api.c
trunk/php5/ext/mysqli/mysqli_api.c
Log:
Fix leaks, this makes a test covering stmt_field_count() pass.
Modified: trunk/ext/mysqli/mysqli_api.c
===================================================================
--- trunk/ext/mysqli/mysqli_api.c 2007-03-16 12:10:56 UTC (rev 175)
+++ trunk/ext/mysqli/mysqli_api.c 2007-03-16 13:44:53 UTC (rev 176)
@@ -157,6 +157,10 @@
MYSQLND_PARAM_BIND *params;
enum_func_status ret = FAIL;
+ /* If no params -> skip binding and return directly */
+ if (argc == start) {
+ return PASS;
+ }
params = emalloc((argc - start) * sizeof(MYSQLND_PARAM_BIND));
for (i = 0; i < (argc - start); i++) {
zend_uchar type;
Modified: trunk/php5/ext/mysqli/mysqli_api.c
===================================================================
--- trunk/php5/ext/mysqli/mysqli_api.c 2007-03-16 12:10:56 UTC (rev 175)
+++ trunk/php5/ext/mysqli/mysqli_api.c 2007-03-16 13:44:53 UTC (rev 176)
@@ -156,6 +156,10 @@
MYSQLND_PARAM_BIND *params;
enum_func_status ret = FAIL;
+ /* If no params -> skip binding and return directly */
+ if (argc == start) {
+ return PASS;
+ }
params = emalloc((argc - start) * sizeof(MYSQLND_PARAM_BIND));
for (i = 0; i < (argc - start); i++) {
zend_uchar type;
| Thread |
|---|
| • PHP mysqlnd svn commit: r176 - in trunk: ext/mysqli php5/ext/mysqli | ahristov | 16 Mar |