diff options
author | ache <ache@FreeBSD.org> | 2000-07-02 04:15:15 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2000-07-02 04:15:15 +0000 |
commit | c350a86095dd249ad9e0371c7caaf6a5c52a0260 (patch) | |
tree | 4ba5279a33c4e68fa9c5635470441a1babb6e79e | |
parent | 5ca3c881886e9bc78cde628cd37f7fa016f5aaae (diff) | |
download | FreeBSD-src-c350a86095dd249ad9e0371c7caaf6a5c52a0260.zip FreeBSD-src-c350a86095dd249ad9e0371c7caaf6a5c52a0260.tar.gz |
Call login_close() to prevent parent from memory leaking in some
cases due to vfork()
-rw-r--r-- | usr.sbin/cron/cron/do_command.c | 2 | ||||
-rw-r--r-- | usr.sbin/cron/cron/popen.c | 2 |
2 files changed, 4 insertions, 0 deletions
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)); } |