diff options
Diffstat (limited to 'usr.sbin/ldpd/control.c')
-rw-r--r-- | usr.sbin/ldpd/control.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.sbin/ldpd/control.c b/usr.sbin/ldpd/control.c index aaad9d2576f..1cbe8a9ef4b 100644 --- a/usr.sbin/ldpd/control.c +++ b/usr.sbin/ldpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.37 2024/11/21 13:21:34 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.38 2024/11/21 13:38:14 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -133,7 +133,13 @@ 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(__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, |