This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug jit/63854] Fix memory leaks seen in JIT
- From: "dmalcolm at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Mon, 12 Jan 2015 19:59:35 +0000
- Subject: [Bug jit/63854] Fix memory leaks seen in JIT
- Auto-submitted: auto-generated
- References: <bug-63854-4 at http dot gcc dot gnu dot org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63854
--- Comment #30 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(In reply to David Binderman from comment #29)
> Similar thing in the same area, caught using static analyser cppcheck:
>
> [gcc/jit/jit-playback.c:1791]: (error) Resource leak: f_in
>
> Source code is
>
> if (!feof (f_in))
> {
> add_error (NULL, "error reading from %s", path);
> free (result);
> return NULL;
> }
>
> fclose (f_in);
>
> It looks to me like a call to fclose needs to happen just before
> the return.
Thanks. I've fixed this in r219487.