Skip to content

Commit 113ef33

Browse files
authored
fix(embed): add missing zend_destroy_file_handle
Refs: #556
1 parent 74a2915 commit 113ef33

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/embed/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ mod sapi;
1010

1111
use crate::boxed::ZBox;
1212
use crate::ffi::{
13-
_zend_file_handle__bindgen_ty_1, php_execute_script, zend_eval_string, zend_file_handle,
14-
zend_stream_init_filename, ZEND_RESULT_CODE_SUCCESS,
13+
_zend_file_handle__bindgen_ty_1, php_execute_script, zend_destroy_file_handle,
14+
zend_eval_string, zend_file_handle, zend_stream_init_filename, ZEND_RESULT_CODE_SUCCESS,
1515
};
1616
use crate::types::{ZendObject, Zval};
1717
use crate::zend::{panic_wrapper, try_catch, ExecutorGlobals};
@@ -107,6 +107,8 @@ impl Embed {
107107

108108
let exec_result = try_catch(|| unsafe { php_execute_script(&raw mut file_handle) });
109109

110+
unsafe { zend_destroy_file_handle(&raw mut file_handle) }
111+
110112
match exec_result {
111113
Err(_) => Err(EmbedError::CatchError),
112114
Ok(true) => Ok(()),

0 commit comments

Comments
 (0)