diff --git a/bin/named/controlconf.c b/bin/named/controlconf.c index bab50ae8e0..6d6e4078d7 100644 --- a/bin/named/controlconf.c +++ b/bin/named/controlconf.c @@ -1256,10 +1256,8 @@ add_listener(named_controls_t *cp, controllistener_t **listenerp, "command channel listening on %s", socktext); *listenerp = listener; } else { - if (listener != NULL) { - listener->exiting = true; - free_listener(listener); - } + listener->exiting = true; + free_listener(listener); if (control != NULL) { cfg_obj_log(control, named_g_lctx, ISC_LOG_WARNING,