]> granicus.if.org Git - php/commitdiff
Fixed the memroy leak first (refactor it later)
authorXinchen Hui <laruence@gmail.com>
Sun, 23 Feb 2014 13:43:59 +0000 (21:43 +0800)
committerXinchen Hui <laruence@gmail.com>
Sun, 23 Feb 2014 13:43:59 +0000 (21:43 +0800)
ext/standard/file.c

index 596bdefc12c957099027828063250532fdf415a4..5004b119c6c5faae044471af5ffea4bf2719219d 100644 (file)
@@ -555,8 +555,9 @@ PHP_FUNCTION(file_get_contents)
        }
 
        if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) {
-//???          RETVAL_STRINGL(contents, len, 0);
+//???  RETVAL_STRINGL(contents, len, 0);
                RETVAL_STRINGL(contents, len);
+               efree(contents);
        } else if (len == 0) {
                RETVAL_EMPTY_STRING();
        } else {