From: Ilia Alshanetsky Date: Wed, 15 Mar 2006 15:25:50 +0000 (+0000) Subject: Fixed memory leak on unused bind var. X-Git-Tag: php-5.1.3RC2~104 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=92ba7cccad8c1ab0e1105ed70a1523ab8b669424;p=php Fixed memory leak on unused bind var. --- diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 591c46e64a..1ea63b9481 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -326,8 +326,11 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s /* tell the driver we just created a parameter */ if (stmt->methods->param_hook) { - if (!stmt->methods->param_hook(stmt, param, - PDO_PARAM_EVT_ALLOC TSRMLS_CC)) { + if (!stmt->methods->param_hook(stmt, param, PDO_PARAM_EVT_ALLOC TSRMLS_CC)) { + if (param->name) { + efree(param->name); + param->name = NULL; + } return 0; } }