mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
Fix memory leak on error return of collation callback in pdo_sqlite
We should destroy it when it's not IS_LONG, not when it's IS_LONG. Closes GH-18332.
This commit is contained in:
parent
bfa2cfc9ed
commit
ce7304f909
2 changed files with 4 additions and 1 deletions
|
@ -352,6 +352,7 @@ static int php_sqlite_collation_callback(void *context, int string1_len, const v
|
|||
zend_type_error("%s(): Return value of the callback must be of type int, %s returned",
|
||||
ZSTR_VAL(func_name), zend_zval_value_name(&retval));
|
||||
zend_string_release(func_name);
|
||||
zval_ptr_dtor(&retval);
|
||||
return FAILURE;
|
||||
}
|
||||
if (Z_LVAL(retval) > 0) {
|
||||
|
@ -359,7 +360,6 @@ static int php_sqlite_collation_callback(void *context, int string1_len, const v
|
|||
} else if (Z_LVAL(retval) < 0) {
|
||||
ret = -1;
|
||||
}
|
||||
zval_ptr_dtor(&retval);
|
||||
}
|
||||
|
||||
zval_ptr_dtor(&zargs[0]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue