This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: fix fopen related cleanups
- From: Daniel Jacobowitz <drow at false dot org>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Tue, 28 Oct 2008 10:20:00 -0400
- Subject: Re: RFA: fix fopen related cleanups
- References: <m3od15pkz4.fsf@fleche.redhat.com>
On Mon, Oct 27, 2008 at 07:27:43PM -0600, Tom Tromey wrote:
> While looking into another issue, I noticed a number of fopen-related
> buglets in gdb. In particular, there are several places in gdb where
> a file is not properly closed if an error occurs.
>
> This patch fixes all the fopen-related problems. It also fixes a
> couple memory leaks I noticed while writing this. Finally, it
> consolidates all the implementations of make_cleanup_fclose, explicit
> or implicit, into a single place.
>
> I think there are also some file-close-related flaws having to do with
> open (procfs_pidlist -- this function is flawed in a few ways) and
> also gdb_fopen (instances in dummy-frame.c, regcache.c, and
> reggroups.c according to my notes). I haven't yet checked opendir,
> socket, or pipe. I will deal with those in separate patches.
>
> Built and regtested on x86-64 (compile farm).
> Of course, this does not show whether the bug is fixed or not.
> For that I relied on inspection.
>
> Please review.
Looks OK to me.
--
Daniel Jacobowitz
CodeSourcery