diff options
Diffstat (limited to 'usr.sbin/rad/control.c')
-rw-r--r-- | usr.sbin/rad/control.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/rad/control.c b/usr.sbin/rad/control.c index 43f1a49af73..3c1ea1a6b86 100644 --- a/usr.sbin/rad/control.c +++ b/usr.sbin/rad/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.13 2024/11/21 13:21:34 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.14 2024/11/21 13:38:15 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -155,7 +155,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, |