From: Florian Krohm Date: Tue, 12 Jan 2016 14:32:05 +0000 (+0000) Subject: VG_(fclose) ought to close the file, you silly. Fixes BZ #357887. X-Git-Tag: svn/VALGRIND_3_12_0~268 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5abaa97db8906aff23c763bfa9746404631fc0da;p=thirdparty%2Fvalgrind.git VG_(fclose) ought to close the file, you silly. Fixes BZ #357887. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15755 --- diff --git a/NEWS b/NEWS index 2d984533c2..4b5a0a3e53 100644 --- a/NEWS +++ b/NEWS @@ -57,6 +57,7 @@ where XXXXXX is the bug number as listed below. 355455 stderr.exp of test cases wrapmalloc and wrapmallocstatic overconstrained 355454 do not intercept malloc related symbols from the runtime linker 356044 Dwarf line info reader misinterprets is_stmt register +357887 Fix a file handle leak. VG_(fclose) did not close the file n-i-bz Fix incorrect (or infinite loop) unwind on RHEL7 x86 32 bits n-i-bz massif --pages-as-heap=yes does not report peak caused by mmap+munmap diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index 1283de59d6..ce2c038257 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -359,6 +359,7 @@ void VG_(fclose)( VgFile *fp ) if (fp->num_chars) VG_(write)(fp->fd, fp->buf, fp->num_chars); + VG_(close)(fp->fd); VG_(free)(fp); }