summaryrefslogtreecommitdiff
path: root/lib/cron/rdcron.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/cron/rdcron.c')
-rw-r--r--lib/cron/rdcron.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/cron/rdcron.c b/lib/cron/rdcron.c
index 1c11cbb..520f969 100644
--- a/lib/cron/rdcron.c
+++ b/lib/cron/rdcron.c
@@ -486,7 +486,8 @@ crontab_t *rdcron(int dirfd, const char *filename)
cron = calloc(1, sizeof(*cron));
if (cron == NULL) {
fputs("out of memory\n", stderr);
- goto out;
+ close(fd);
+ return NULL;
}
cron->minute = 0xFFFFFFFFFFFFFFFFUL;
@@ -501,7 +502,6 @@ crontab_t *rdcron(int dirfd, const char *filename)
delcron(cron);
cron = NULL;
}
-out:
- close(fd);
+ rdline_cleanup(&rd);
return cron;
}