diff --git a/NEWS b/NEWS index 376139b086f..f2a0b0246d1 100644 --- a/NEWS +++ b/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 diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index 2000e15c29e..d823f32127c 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -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; }