diff --git a/NEWS b/NEWS index c95271028c6..e8b40fdcba4 100644 --- a/NEWS +++ b/NEWS @@ -34,6 +34,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) - Fileinfo: . Fixed bug GH-17039 (PHP 8.4: Incorrect MIME content type). (nielsdos) diff --git a/ext/ffi/ffi.c b/ext/ffi/ffi.c index a0451bc38de..8ea8b145200 100644 --- a/ext/ffi/ffi.c +++ b/ext/ffi/ffi.c @@ -808,6 +808,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; }