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
3
NEWS
3
NEWS
|
@ -45,6 +45,9 @@ PHP NEWS
|
||||||
. Fixed GH-18276 - persistent connection - "zend_mm_heap corrupted"
|
. Fixed GH-18276 - persistent connection - "zend_mm_heap corrupted"
|
||||||
with setAttribute() (SakiTakamachi).
|
with setAttribute() (SakiTakamachi).
|
||||||
|
|
||||||
|
- PDO Sqlite:
|
||||||
|
. Fix memory leak on error return of collation callback. (nielsdos)
|
||||||
|
|
||||||
- SPL:
|
- SPL:
|
||||||
. Fixed bug GH-18322 (SplObjectStorage debug handler mismanages memory).
|
. Fixed bug GH-18322 (SplObjectStorage debug handler mismanages memory).
|
||||||
(nielsdos)
|
(nielsdos)
|
||||||
|
|
|
@ -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",
|
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));
|
ZSTR_VAL(func_name), zend_zval_value_name(&retval));
|
||||||
zend_string_release(func_name);
|
zend_string_release(func_name);
|
||||||
|
zval_ptr_dtor(&retval);
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
if (Z_LVAL(retval) > 0) {
|
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) {
|
} else if (Z_LVAL(retval) < 0) {
|
||||||
ret = -1;
|
ret = -1;
|
||||||
}
|
}
|
||||||
zval_ptr_dtor(&retval);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
zval_ptr_dtor(&zargs[0]);
|
zval_ptr_dtor(&zargs[0]);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue