]> granicus.if.org Git - php/commitdiff
Return empty string
authorXinchen Hui <laruence@gmail.com>
Mon, 3 Mar 2014 15:09:31 +0000 (23:09 +0800)
committerXinchen Hui <laruence@gmail.com>
Mon, 3 Mar 2014 15:09:31 +0000 (23:09 +0800)
ext/standard/file.c

index ffe9b00b2bf88c2080b8a6a8c29fe65fe5161a49..036705617246da664b5fcb290a2f74a7b5390dc1 100644 (file)
@@ -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);
 }