mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix memory leak on ZEND_FFI_TYPE_CHAR conversion failure
The success path frees tmp_str, but the error path does not. Closes GH-17243.
This commit is contained in:
1
NEWS
1
NEWS
@@ -24,6 +24,7 @@ PHP NEWS
|
||||
|
||||
- FFI:
|
||||
. Fixed bug #79075 (FFI header parser chokes on comments). (nielsdos)
|
||||
. Fix memory leak on ZEND_FFI_TYPE_CHAR conversion failure. (nielsdos)
|
||||
|
||||
- Filter:
|
||||
. Fixed bug GH-16944 (Fix filtering special IPv4 and IPv6 ranges, by using
|
||||
|
||||
@@ -807,6 +807,7 @@ again:
|
||||
if (ZSTR_LEN(str) == 1) {
|
||||
*(char*)ptr = ZSTR_VAL(str)[0];
|
||||
} else {
|
||||
zend_tmp_string_release(tmp_str);
|
||||
zend_ffi_assign_incompatible(value, type);
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user