summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorFlorian Obser <florian@cvs.openbsd.org>2019-01-25 17:20:46 +0000
committerFlorian Obser <florian@cvs.openbsd.org>2019-01-25 17:20:46 +0000
commit6f6f926dc1b333c4059f8f121c82e917c3488453 (patch)
treeece1af075c655745dcf87cac1a634ae718f55b5e /sbin
parentcee77f2b219890ea46b4e772fd7b5595b96ffc33 (diff)
We are not holding on to a ref to the resolver if ub_resolve_event fails.
Diffstat (limited to 'sbin')
-rw-r--r--sbin/unwind/resolver.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/unwind/resolver.c b/sbin/unwind/resolver.c
index 4ae61e15220..93dc08e2ff9 100644
--- a/sbin/unwind/resolver.c
+++ b/sbin/unwind/resolver.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: resolver.c,v 1.8 2019/01/25 11:08:03 florian Exp $ */
+/* $OpenBSD: resolver.c,v 1.9 2019/01/25 17:20:45 florian Exp $ */
/*
* Copyright (c) 2018 Florian Obser <florian@openbsd.org>
@@ -338,9 +338,11 @@ resolver_dispatch_frontend(int fd, short event, void *bula)
if ((err = ub_resolve_event(res->ctx,
query_imsg->qname, query_imsg->t, query_imsg->c,
(void *)query_imsg, resolve_done,
- &query_imsg->async_id)) != 0)
+ &query_imsg->async_id)) != 0) {
log_warn("%s: ub_resolve_async: err: %d, %s",
__func__, err, ub_strerror(err));
+ resolver_unref(res);
+ }
break;
case IMSG_FORWARDER:
/* make sure this is a string */