From bac4f837ee024e37c804b607507b2360e2f39c77 Mon Sep 17 00:00:00 2001 From: millert Date: Fri, 1 Nov 1996 23:27:28 +0000 Subject: Check malloc/strdup ret val and deal. --- usr.sbin/cron/job.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'usr.sbin/cron/job.c') 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; -- cgit v1.2.3-59-g8ed1b