]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
login-utils: use free_getlogindefs_data()
authorKarel Zak <kzak@redhat.com>
Tue, 28 Nov 2017 13:49:05 +0000 (14:49 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Nov 2017 13:49:05 +0000 (14:49 +0100)
It seems better to deallocate logindefs.conf stuff in long time
running (=waiting) processes like login(1) and su(1).

Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/login.c
login-utils/su-common.c

index ae0d66d0a78502af39e6e286269a1e2172ee899d..cc14002461a1dbe6fdee46e7c1d2f336dcc02392 100644 (file)
@@ -945,6 +945,8 @@ static void fork_session(struct login_context *cxt)
                close(0);
                close(1);
                close(2);
+               free_getlogindefs_data();
+
                sa.sa_handler = SIG_IGN;
                sigaction(SIGQUIT, &sa, NULL);
                sigaction(SIGINT, &sa, NULL);
index 0ba6d19534efe4282dbe0a460e78b2906b5bc940..b1be7c6ef429f45e2845af4261c8a1b76bbe9093 100644 (file)
@@ -854,6 +854,8 @@ static void create_watching_parent(struct su_context *su)
                break;
        }
 
+       /* free unnecessary stuff */
+       free_getlogindefs_data();
 
        /* In the parent watch the child.  */