From c39106906d662799cfefd0ec2393384f7e1c9973 Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Tue, 17 May 2022 14:28:04 +0200 Subject: [PATCH] Check return value from iwatch_init(), found by Coverity Signed-off-by: Joachim Wiberg --- src/cgroup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cgroup.c b/src/cgroup.c index 5dec89d2..3704b06b 100644 --- a/src/cgroup.c +++ b/src/cgroup.c @@ -511,6 +511,9 @@ void cgroup_init(uev_ctx_t *ctx) /* prepare cgroup.events watcher */ fd = iwatch_init(&iw_cgroup); + if (fd == -1) + goto abort; + if (uev_io_init(ctx, &cgw, cgroup_events_cb, NULL, fd, UEV_READ)) { _pe("Failed setting up cgroup.events watcher"); iwatch_exit(&iw_cgroup);