Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: cap leak



This patch is from Martin Waitz, who noticed that caps wouldn't be freed
if(val).

--- Src/utils.c.orig    2002-10-10 23:59:28.000000000 +0200
+++ Src/utils.c 2002-10-11 00:00:55.000000000 +0200
@@ -3670,7 +3670,10 @@ privasserted(void)
 	    cap_flag_value_t val;
 	    cap_value_t n;
 	    for(n = 0; !cap_get_flag(caps, n, CAP_EFFECTIVE, &val); n++)
-		if(val) return 1;
+		if(val) {
+		    cap_free(caps);
+		    return 1;
+		}
 	    cap_free(caps);
 	}
     }


-- System Information:
Debian Release: testing/unstable
Architecture: i386
Kernel: Linux pergament 2.4.19-pergament0 #1 Son Aug 25 17:07:17 CEST 2002 i686
Locale: LANG=C, LC_CTYPE=de_DE@euro

Versions of packages zsh depends on:
ii  debconf                  1.2.10          Debian configuration management sy
ii  libc6                    2.2.5-15        GNU C Library: Shared libraries an
ii  libcap1                  1:1.10-12       support for getting/setting POSIX.
ii  libncurses5              5.2.20020112a-8 Shared libraries for terminal hand

-- debconf information excluded


----- End forwarded message -----



Messages sorted by: Reverse Date, Date, Thread, Author