aboutsummaryrefslogtreecommitdiff
path: root/reaper.c
diff options
context:
space:
mode:
Diffstat (limited to 'reaper.c')
-rw-r--r--reaper.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/reaper.c b/reaper.c
index 83db9f47..adc89e3c 100644
--- a/reaper.c
+++ b/reaper.c
@@ -40,6 +40,13 @@ reaper_init(struct fdm *fdm)
}
struct reaper *reaper = malloc(sizeof(*reaper));
+ if (unlikely(reaper == NULL)) {
+ LOG_ERRNO("malloc() failed");
+ close(fd);
+ sigprocmask(SIG_UNBLOCK, &mask, NULL);
+ return NULL;
+ }
+
*reaper = (struct reaper){
.fdm = fdm,
.fd = fd,