summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/job.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>1996-11-01 23:27:28 +0000
committermillert <millert@openbsd.org>1996-11-01 23:27:28 +0000
commitbac4f837ee024e37c804b607507b2360e2f39c77 (patch)
treed4683b5672c804612e83cf49c4295d48034239ac /usr.sbin/cron/job.c
parentargument type nit (diff)
downloadwireguard-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.c5
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;