Re: File descriptor leak in tdlookup.c:respond

Jeff King <[email protected]>
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
On Tue, Feb 17, 2009 at 01:07:04PM -0800, Matthew Dempsky wrote:

> Has anyone noticed there's a potential file descriptor leak in
> tdlookup.c's respond() function?  I searched for this issue for a
> little bit, and I couldn't find anything about it.
> 
> If there's a cdb_read error while looking up the client's location,
> then the data.cdb file descriptor is never closed.  (cdb_free(&c) is
> also not called, but cdb_init(&c,fd) first calls cdb_free(&c), so it
> doesn't leak memory.)  In practice, I don't think this is a problem
> because I think the only reason cdb_read might realistically error is
> because of a misformatted cdb file, which tinydns-data won't build.

This sounded vaguely familiar, and some searching turned up:

  http://marc.info/?t=116363683200001&r=1&w=2

It looks like the only person who had a problem with this in practice
was doing a "cp" over his cdb file.

-Peff
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.