From: Arnaud Le Blanc Date: Sun, 14 Sep 2008 14:55:50 +0000 (+0000) Subject: Fix leak in fgetc() X-Git-Tag: BEFORE_HEAD_NS_CHANGE~394 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35fad44b7b8b8839e9e2dd30abe6748ca6c58127;p=php Fix leak in fgetc() --- diff --git a/ext/standard/file.c b/ext/standard/file.c index bd407d2c4d..8f2669b957 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -1185,6 +1185,9 @@ PHPAPI PHP_FUNCTION(fgetc) UChar *buf = php_stream_read_unicode_chars(stream, &buflen); if (!buf || !buflen) { + if (buf) { + efree(buf); + } RETURN_FALSE; } RETURN_UNICODEL(buf, buflen, 0);