Re: File descriptor leak in tdlookup.c:respond

Mark Johnson <[email protected]>
Newsgroups gmane.network.djbdns
Message-ID <[email protected]>
On Tue, Feb 17, 2009 at 3:07 PM, Matthew Dempsky <[email protected]> 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.

http://marc.info/?l=djbdns&m=116386827613118&w=2

Is that the same issue?

> 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.

Looks like has bitten somebody already.  The root cause is something
else (horked cdb, horked filesystem), but leaking file descriptors
doesn't help.
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.