From d821c9014887ae8fa5ad032ec3c04df7efafa55b Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Mon, 3 Mar 2014 23:09:31 +0800 Subject: [PATCH] Return empty string --- ext/standard/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ext/standard/file.c b/ext/standard/file.c index ffe9b00b2b..0367056172 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -556,7 +556,7 @@ PHP_FUNCTION(file_get_contents) if ((contents = php_stream_copy_to_mem(stream, maxlen, 0)) != NULL) { RETVAL_STR(contents); } else { - RETVAL_FALSE; + RETVAL_STR(STR_EMPTY_ALLOC()); } php_stream_close(stream); @@ -825,6 +825,9 @@ PHP_FUNCTION(tempnam) close(fd); //??? RETVAL_STRING(opened_path, 0); RETVAL_STRING(opened_path); + //??? temporary fixed the memory leak, I've tried to make opened_path a zend_string + //but too too many places need to be changed.... let's keep it simple for now + efree(opened_path); } STR_RELEASE(p); } -- 2.50.1