diff options
author | millert <millert@openbsd.org> | 1996-11-01 23:27:28 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 1996-11-01 23:27:28 +0000 |
commit | bac4f837ee024e37c804b607507b2360e2f39c77 (patch) | |
tree | d4683b5672c804612e83cf49c4295d48034239ac /usr.sbin/cron/job.c | |
parent | argument type nit (diff) | |
download | wireguard-openbsd-bac4f837ee024e37c804b607507b2360e2f39c77.tar.xz wireguard-openbsd-bac4f837ee024e37c804b607507b2360e2f39c77.zip |
Check malloc/strdup ret val and deal.
Diffstat (limited to 'usr.sbin/cron/job.c')
-rw-r--r-- | usr.sbin/cron/job.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/usr.sbin/cron/job.c b/usr.sbin/cron/job.c index 69047fc0940..18e96b6e36b 100644 --- a/usr.sbin/cron/job.c +++ b/usr.sbin/cron/job.c @@ -16,7 +16,7 @@ */ #if !defined(lint) && !defined(LINT) -static char rcsid[] = "$Id: job.c,v 1.1.1.1 1995/10/18 08:47:30 deraadt Exp $"; +static char rcsid[] = "$Id: job.c,v 1.2 1996/11/01 23:27:36 millert Exp $"; #endif @@ -45,7 +45,8 @@ job_add(e, u) if (j->e == e && j->u == u) { return; } /* build a job queue element */ - j = (job*)malloc(sizeof(job)); + if ((j = (job*)malloc(sizeof(job))) == NULL) + return; j->next = (job*) NULL; j->e = e; j->u = u; |