[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-ext4
Subject:    Re: [PATCH] debugfs: don't try to fclose NULL
From:       Alex Buell <alex.buell () munted ! org ! uk>
Date:       2009-06-30 16:46:23
Message-ID: 1246380383.11440.2.camel () lithium ! local ! net
[Download RAW message or body]

On Tue, 2009-06-30 at 12:39 -0400, Theodore Tso wrote:
> On Tue, Jun 30, 2009 at 05:44:55PM +0200, Thierry Vignaud wrote:
> > Eric Sandeen <sandeen@redhat.com> writes:
> > 
> > > do_logdump may jump to errout if fopen(out_file) fails, 
> > > but in that case out_file is NULL, and fclose will segfault.
> > 
> > You should report that segfault to glibc authors too.
> 
> It would be robust for glibc to code fclose() defensively such that it
> would survive a null pointer, but I don't think it's technically
> required by the ANSI or POSIX spec.

It's the programmer's responsibility to write the following:

if (fp)
	fclose(fp);

-- 
http://www.munted.org.uk

One very high maintenance cat living here.
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic