diff options
author | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:38:16 +0000 |
---|---|---|
committer | Claudio Jeker <claudio@cvs.openbsd.org> | 2024-11-21 13:38:16 +0000 |
commit | d54f1ade2567f1c6dc26b339312d1336d564a152 (patch) | |
tree | 74538403c70e3e601a2afbb807050093ec09275e /usr.sbin/ripd/control.c | |
parent | 33a588df978f85e7cafd5cb8ad0c0488cf1d643e (diff) |
Convert simple stuff in usr.sbin over to new imsgbuf_init behaviour
OK tb@
Diffstat (limited to 'usr.sbin/ripd/control.c')
-rw-r--r-- | usr.sbin/ripd/control.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/ripd/control.c b/usr.sbin/ripd/control.c index f651e4887a1..20689670b47 100644 --- a/usr.sbin/ripd/control.c +++ b/usr.sbin/ripd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.33 2024/11/21 13:21:34 claudio Exp $ */ +/* $OpenBSD: control.c,v 1.34 2024/11/21 13:38:15 claudio Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -143,7 +143,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("control_accept"); + 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, |