summaryrefslogtreecommitdiff
path: root/libunbound/libworker.c
diff options
context:
space:
mode:
Diffstat (limited to 'libunbound/libworker.c')
-rw-r--r--libunbound/libworker.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libunbound/libworker.c b/libunbound/libworker.c
index a886f9a881137..01621927eb5bb 100644
--- a/libunbound/libworker.c
+++ b/libunbound/libworker.c
@@ -222,11 +222,10 @@ libworker_setup(struct ub_ctx* ctx, int is_bg, struct ub_event_base* eb)
}
numports = cfg_condense_ports(cfg, &ports);
if(numports == 0) {
- int locked = !w->is_bg || w->is_bg_thread;
- libworker_delete(w);
- if(locked) {
+ if(!w->is_bg || w->is_bg_thread) {
lock_basic_unlock(&ctx->cfglock);
}
+ libworker_delete(w);
return NULL;
}
w->back = outside_network_create(w->base, cfg->msg_buffer_size,