]> granicus.if.org Git - php/commitdiff
MFZE1
authorIlia Alshanetsky <iliaa@php.net>
Sat, 2 Nov 2002 16:52:59 +0000 (16:52 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 2 Nov 2002 16:52:59 +0000 (16:52 +0000)
Zend/zend_language_scanner.l

index d0b758e6decc034f4d885c1deb9e0b9e2ce4c79a..2c1e21fdb1882ee937a760a131984bcac7663f2d 100644 (file)
@@ -319,6 +319,7 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
        zend_file_handle file_handle;
        zval tmp;
        zend_op_array *retval;
+       char *opened_path = NULL;
 
        if (filename->type != IS_STRING) {
                tmp = *filename;
@@ -337,10 +338,14 @@ zend_op_array *compile_filename(int type, zval *filename TSRMLS_DC)
                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);