summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-06-11 17:06:06 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-06-11 17:06:06 +0000
commit648eb8dfccf457fc2fbd01286718629b006524fa (patch)
tree23381570741b3188468d2321cbbd79f7011ec9fb /src
parent393a729f2f74eb1ca0ba710baacca80024213769 (diff)
downloads6-dns-648eb8dfccf457fc2fbd01286718629b006524fa.tar.xz
- Fix s6dns-resolve.h for C++ inclusionv2.0.0.4
- Fix leak in s6dns_resolve_core.c - version: 2.0.0.4
Diffstat (limited to 'src')
-rw-r--r--src/include/s6-dns/s6dns-resolve.h2
-rw-r--r--src/libs6dns/s6dns_resolve_core.c9
2 files changed, 8 insertions, 3 deletions
diff --git a/src/include/s6-dns/s6dns-resolve.h b/src/include/s6-dns/s6dns-resolve.h
index e7eb629..805ea2a 100644
--- a/src/include/s6-dns/s6dns-resolve.h
+++ b/src/include/s6-dns/s6dns-resolve.h
@@ -220,7 +220,7 @@ extern int s6dns_resolve_mpag_r (stralloc *, genalloc *, char const *, unsigned
*/
extern int s6dns_resolven_loop (s6dns_engine_t_ref, unsigned int, unsigned int, tain_t const *, tain_t *) ;
-#define s6dns_resolven_loop_g(list, n, or, deadline) s6dns_resolven(list, n, or, (deadline), &STAMP)
+#define s6dns_resolven_loop_g(list, n, zor, deadline) s6dns_resolven(list, n, zor, (deadline), &STAMP)
typedef struct s6dns_resolve_s s6dns_resolve_t, *s6dns_resolve_t_ref ;
struct s6dns_resolve_s
diff --git a/src/libs6dns/s6dns_resolve_core.c b/src/libs6dns/s6dns_resolve_core.c
index 0b75f07..a3c51c1 100644
--- a/src/libs6dns/s6dns_resolve_core.c
+++ b/src/libs6dns/s6dns_resolve_core.c
@@ -11,6 +11,11 @@
int s6dns_resolve_core_r (s6dns_domain_t const *d, uint16 qtype, s6dns_engine_t *dt, s6dns_ip46list_t const *servers, s6dns_debughook_t const *dbh, tain_t const *deadline, tain_t *stamp)
{
- return s6dns_engine_init_r(dt, servers, S6DNS_O_RECURSIVE, d->s, d->len, qtype, dbh, deadline, stamp)
- && s6dns_resolve_loop_r(dt, deadline, stamp) ;
+ if (!s6dns_engine_init_r(dt, servers, S6DNS_O_RECURSIVE, d->s, d->len, qtype, dbh, deadline, stamp)) return 0 ;
+ if (!s6dns_resolve_loop_r(dt, deadline, stamp))
+ {
+ s6dns_engine_recycle(dt) ;
+ return 0 ;
+ }
+ return 1 ;
}