mirror of
https://github.com/troglobit/finit.git
synced 2026-10-25 12:04:36 +00:00
Check return value from uev_io_init() at runtime
Possible resource leak due to unchecked return value from uev_io_init() found by Coverity Scan. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
e53acd1cdd
commit
662f364d09
3 files changed
+11
-3
No files matched your search
@@ -239,7 +239,13 @@ static int spawn_socket(inetd_t *inetd)
|
||||
}
|
||||
}
|
||||
|
||||
uev_io_init(ctx, &inetd->watcher, socket_cb, inetd->svc, sd, UEV_READ);
|
||||
if (uev_io_init(ctx, &inetd->watcher, socket_cb, inetd->svc, sd, UEV_READ)) {
|
||||
FLOG_PERROR("Failed setting up inetd watcher for %s", inetd->name);
|
||||
close(sd);
|
||||
return -errno;
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user