packages/net/djbdns/patches/050-tinydns-mmap-leak.patch
nbd 0e7a8e9b4e djbdns: fix compile errors because of wrong ranlib use, also apply Johnny Halfmoon's update to 1.05-5 (#5764)
git-svn-id: svn://svn.openwrt.org/openwrt/packages@17673 3c298f89-4303-0410-b956-a3cf2f4a3e73
2009-09-22 08:45:48 +00:00

23 lines
551 B
Diff

--- a/tdlookup.c
+++ b/tdlookup.c
@@ -298,9 +298,17 @@ int respond(char *q,char qtype[2],char i
if (!r) r = cdb_find(&c,key,4);
if (!r) r = cdb_find(&c,key,3);
if (!r) r = cdb_find(&c,key,2);
- if (r == -1) return 0;
+ if (r == -1) {
+ cdb_free(&c);
+ close(fd);
+ return 0;
+ }
if (r && (cdb_datalen(&c) == 2))
- if (cdb_read(&c,clientloc,2,cdb_datapos(&c)) == -1) return 0;
+ if (cdb_read(&c,clientloc,2,cdb_datapos(&c)) == -1) {
+ cdb_free(&c);
+ close(fd);
+ return 0;
+ }
r = doit(q,qtype);