summaryrefslogtreecommitdiffstats
path: root/usr.sbin/cron/lib/entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/cron/lib/entry.c')
-rw-r--r--usr.sbin/cron/lib/entry.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/cron/lib/entry.c b/usr.sbin/cron/lib/entry.c
index c7562a2..2554827 100644
--- a/usr.sbin/cron/lib/entry.c
+++ b/usr.sbin/cron/lib/entry.c
@@ -73,8 +73,10 @@ free_entry(e)
if (e->class != NULL)
free(e->class);
#endif
- free(e->cmd);
- env_free(e->envp);
+ if (e->cmd != NULL)
+ free(e->cmd);
+ if (e->envp != NULL)
+ env_free(e->envp);
free(e);
}
@@ -399,7 +401,6 @@ load_entry(file, error_func, pw, envp)
/* a file without a \n before the EOF is rude, so we'll complain...
*/
if (ch == EOF) {
- env_free(e->envp);
ecode = e_cmd;
goto eof;
}
@@ -409,7 +410,6 @@ load_entry(file, error_func, pw, envp)
e->cmd = strdup(cmd);
if (e->cmd == NULL) {
warn("strdup(\"%d\")", cmd);
- env_free(e->envp);
ecode = e_mem;
goto eof;
}
OpenPOWER on IntegriCloud