From c350a86095dd249ad9e0371c7caaf6a5c52a0260 Mon Sep 17 00:00:00 2001 From: ache Date: Sun, 2 Jul 2000 04:15:15 +0000 Subject: Call login_close() to prevent parent from memory leaking in some cases due to vfork() --- usr.sbin/cron/cron/do_command.c | 2 ++ usr.sbin/cron/cron/popen.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'usr.sbin/cron/cron') diff --git a/usr.sbin/cron/cron/do_command.c b/usr.sbin/cron/cron/do_command.c index 1e65b41..cc19f4a 100644 --- a/usr.sbin/cron/cron/do_command.c +++ b/usr.sbin/cron/cron/do_command.c @@ -251,6 +251,8 @@ child_process(e, u) setuid(e->uid); /* we aren't root after this..*/ #if defined(LOGIN_CAP) } + if (lc != NULL) + login_close(lc); #endif chdir(env_get("HOME", e->envp)); diff --git a/usr.sbin/cron/cron/popen.c b/usr.sbin/cron/cron/popen.c index 56f85e7..1ac775d 100644 --- a/usr.sbin/cron/cron/popen.c +++ b/usr.sbin/cron/cron/popen.c @@ -182,6 +182,8 @@ cron_popen(program, type, e) setuid(e->uid); /* we aren't root after this..*/ #if defined(LOGIN_CAP) } + if (lc != NULL) + login_close(lc); #endif chdir(env_get("HOME", e->envp)); } -- cgit v1.1