]> granicus.if.org Git - sudo/commitdiff
delref list_pw before exit
authorTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 15 Jan 2011 17:29:35 +0000 (12:29 -0500)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Sat, 15 Jan 2011 17:29:35 +0000 (12:29 -0500)
--HG--
branch : 1.7

sudo.c

diff --git a/sudo.c b/sudo.c
index 185e1ee032d668acbe1ce690b3c2bd8b0b523b9b..f65946be6acb13a15fba8c67798052f466f5ee88 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -486,8 +486,11 @@ main(argc, argv, envp)
 #endif
 
        /* Deferred exit due to sudo_ldap_close() */
-       if (ISSET(sudo_mode, (MODE_VALIDATE|MODE_CHECK|MODE_LIST)))
+       if (ISSET(sudo_mode, (MODE_VALIDATE|MODE_CHECK|MODE_LIST))) {
+           if (list_pw != NULL)
+               pw_delref(list_pw);
            exit(rc);
+       }
 
        /* Must audit before uid change. */
        audit_success(NewArgv);