From 58e96c4c105a16406444e248d6a76f356bee624d Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Sat, 27 Jan 2007 21:53:26 +0000 Subject: [PATCH] nullify param.parameter and avoid destroying it twice --- ext/pdo/pdo_stmt.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.50.1