zend_file_handle file_handle;
zval tmp;
zend_op_array *retval;
+ char *opened_path = NULL;
if (filename->type != IS_STRING) {
tmp = *filename;
int dummy = 1;
if (!file_handle.opened_path) {
- file_handle.opened_path = filename->value.str.val;
+ file_handle.opened_path = opened_path = estrndup(filename->value.str.val, filename->value.str.len);
}
zend_hash_add(&EG(included_files), file_handle.opened_path, strlen(file_handle.opened_path)+1, (void *)&dummy, sizeof(int), NULL);
+
+ if (opened_path) {
+ efree(opened_path);
+ }
}
zend_destroy_file_handle(&file_handle TSRMLS_CC);