summaryrefslogtreecommitdiff
path: root/sbin/dhcp6leased/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'sbin/dhcp6leased/control.c')
-rw-r--r--sbin/dhcp6leased/control.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/dhcp6leased/control.c b/sbin/dhcp6leased/control.c
index df3da1035c3..699e5aeac3d 100644
--- a/sbin/dhcp6leased/control.c
+++ b/sbin/dhcp6leased/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.8 2024/11/21 13:21:33 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.9 2024/11/21 13:35:20 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -156,7 +156,12 @@ control_accept(int listenfd, short event, void *bula)
return;
}
- imsgbuf_init(&c->iev.ibuf, connfd);
+ if (imsgbuf_init(&c->iev.ibuf, connfd) == -1) {
+ log_warn("%s: imsgbuf_init", __func__);
+ close(connfd);
+ free(c);
+ return;
+ }
c->iev.handler = control_dispatch_imsg;
c->iev.events = EV_READ;
event_set(&c->iev.ev, c->iev.ibuf.fd, c->iev.events,