summaryrefslogtreecommitdiff
path: root/src/libs6dns
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs6dns')
-rw-r--r--src/libs6dns/s6dns_resolve_core.c9
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 ;
}