mirror of
https://github.com/php/php-src.git
synced 2025-01-10 21:14:37 +08:00
MFB: Fixed memory leak on unused bound name parameters.
This commit is contained in:
parent
6582daf259
commit
06bc5e1b46
@ -1452,7 +1452,11 @@ static int register_bound_param(INTERNAL_FUNCTION_PARAMETERS, pdo_stmt_t *stmt,
|
||||
}
|
||||
|
||||
ZVAL_ADDREF(param.parameter);
|
||||
return really_register_bound_param(¶m, stmt, is_param TSRMLS_CC);
|
||||
if (!really_register_bound_param(¶m, stmt, is_param TSRMLS_CC)) {
|
||||
zval_ptr_dtor(&(param.parameter));
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
} /* }}} */
|
||||
|
||||
/* {{{ proto bool PDOStatement::bindValue(mixed $paramno, mixed $param [, int $type ])
|
||||
@ -1481,7 +1485,11 @@ static PHP_METHOD(PDOStatement, bindValue)
|
||||
}
|
||||
|
||||
ZVAL_ADDREF(param.parameter);
|
||||
RETURN_BOOL(really_register_bound_param(¶m, stmt, TRUE TSRMLS_CC));
|
||||
if (!really_register_bound_param(¶m, stmt, TRUE TSRMLS_CC)) {
|
||||
zval_ptr_dtor(&(param.parameter));
|
||||
RETURN_FALSE;
|
||||
}
|
||||
RETURN_TRUE;
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user