From: Antony Dovgal Date: Sat, 27 Jan 2007 21:53:26 +0000 (+0000) Subject: nullify param.parameter and avoid destroying it twice X-Git-Tag: php-5.2.1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=58e96c4c105a16406444e248d6a76f356bee624d;p=php nullify param.parameter and avoid destroying it twice --- diff --git a/ext/pdo/pdo_stmt.c b/ext/pdo/pdo_stmt.c index 16fed3f4fb..4679b39e8c 100755 --- a/ext/pdo/pdo_stmt.c +++ b/ext/pdo/pdo_stmt.c @@ -370,6 +370,8 @@ static int really_register_bound_param(struct pdo_bound_param_data *param, pdo_s } else { zend_hash_index_del(hash, pparam->paramno); } + /* param->parameter is freed by hash dtor */ + param->parameter = NULL; return 0; } } @@ -428,7 +430,9 @@ static PHP_METHOD(PDOStatement, execute) INIT_PZVAL(param.parameter); if (!really_register_bound_param(¶m, stmt, 1 TSRMLS_CC)) { - zval_ptr_dtor(¶m.parameter); + if (param.parameter) { + zval_ptr_dtor(¶m.parameter); + } RETURN_FALSE; }