diff options
author | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-11 17:06:06 +0000 |
---|---|---|
committer | Laurent Bercot <ska-skaware@skarnet.org> | 2015-06-11 17:06:06 +0000 |
commit | 648eb8dfccf457fc2fbd01286718629b006524fa (patch) | |
tree | 23381570741b3188468d2321cbbd79f7011ec9fb /src/libs6dns | |
parent | 393a729f2f74eb1ca0ba710baacca80024213769 (diff) | |
download | s6-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/libs6dns')
-rw-r--r-- | src/libs6dns/s6dns_resolve_core.c | 9 |
1 files changed, 7 insertions, 2 deletions
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 ; } |