summaryrefslogtreecommitdiff
path: root/ext/mysqli/mysqli_api.c
diff options
context:
space:
mode:
authorAndrey Hristov <andrey@php.net>2010-03-12 13:03:46 +0000
committerAndrey Hristov <andrey@php.net>2010-03-12 13:03:46 +0000
commit564a1d07f893137870820e882301fabdb3668227 (patch)
tree306e3596a465103bd78ba865c2d0dcc7c642e70c /ext/mysqli/mysqli_api.c
parentd9dda48f8a7e182ed8c0f56e5fde9e367131a07a (diff)
downloadphp-git-564a1d07f893137870820e882301fabdb3668227.tar.gz
allow persistency of PS
Diffstat (limited to 'ext/mysqli/mysqli_api.c')
-rw-r--r--ext/mysqli/mysqli_api.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ext/mysqli/mysqli_api.c b/ext/mysqli/mysqli_api.c
index e4d61310b3..d2cc043da8 100644
--- a/ext/mysqli/mysqli_api.c
+++ b/ext/mysqli/mysqli_api.c
@@ -166,7 +166,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned in
if (argc == start) {
return PASS;
}
- params = safe_emalloc(argc - start, sizeof(MYSQLND_PARAM_BIND), 0);
+ params = mysqlnd_stmt_alloc_param_bind(stmt->stmt);
for (i = 0; i < (argc - start); i++) {
zend_uchar type;
switch (types[i]) {
@@ -190,7 +190,7 @@ int mysqli_stmt_bind_param_do_bind(MY_STMT *stmt, unsigned int argc, unsigned in
/* We count parameters from 1 */
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Undefined fieldtype %c (parameter %d)", types[i], i + start + 1);
ret = FAIL;
- efree(params);
+ mysqlnd_stmt_free_param_bind(stmt->stmt, params);
goto end;
}
params[i].zv = *(args[i + start]);
@@ -452,9 +452,7 @@ static int
mysqli_stmt_bind_result_do_bind(MY_STMT *stmt, zval ***args, unsigned int argc, unsigned int start TSRMLS_DC)
{
unsigned int i;
- MYSQLND_RESULT_BIND *params;
-
- params = safe_emalloc(argc - start, sizeof(MYSQLND_RESULT_BIND), 0);
+ MYSQLND_RESULT_BIND * params = mysqlnd_stmt_alloc_result_bind(stmt->stmt);
for (i = 0; i < (argc - start); i++) {
params[i].zv = *(args[i + start]);
}