summaryrefslogtreecommitdiff
path: root/usr.sbin/ospfd/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ospfd/control.c')
-rw-r--r--usr.sbin/ospfd/control.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/ospfd/control.c b/usr.sbin/ospfd/control.c
index 482af7f017c..43393e85fb0 100644
--- a/usr.sbin/ospfd/control.c
+++ b/usr.sbin/ospfd/control.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: control.c,v 1.53 2024/11/21 13:21:34 claudio Exp $ */
+/* $OpenBSD: control.c,v 1.54 2024/11/21 13:38:14 claudio Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -176,7 +176,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("imsgbuf_init");
+ 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,