]> granicus.if.org Git - sudo/commitdiff
delref the old runas group in set_runasgr()
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 4 Aug 2010 13:43:29 +0000 (09:43 -0400)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 4 Aug 2010 13:43:29 +0000 (09:43 -0400)
--HG--
branch : 1.7

sudo.c

diff --git a/sudo.c b/sudo.c
index 8e25d24a2681c342ed67b4d6cd5f27685704a300..650a4555cdce1f2db046acc9081980d852476832 100644 (file)
--- a/sudo.c
+++ b/sudo.c
@@ -1276,13 +1276,15 @@ set_runaspw(user)
 }
 
 /*
- * Get group entry for the group we are going to run commands as.
- * Updates runas_pw as a side effect.
+ * Get group entry for the group we are going to run commands as
+ * and store it in runas_gr.
  */
 static void
 set_runasgr(group)
     char *group;
 {
+    if (runas_gr != NULL)
+       gr_delref(runas_gr);
     if (*group == '#') {
        if ((runas_gr = sudo_getgrgid(atoi(group + 1))) == NULL)
            runas_gr = sudo_fakegrnam(group);