From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13335 invoked from network); 11 Oct 2002 01:05:10 -0000 Received: from sunsite.dk (130.225.247.90) by ns1.primenet.com.au with SMTP; 11 Oct 2002 01:05:10 -0000 Received: (qmail 12900 invoked by alias); 11 Oct 2002 01:05:01 -0000 Mailing-List: contact zsh-workers-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 17810 Received: (qmail 12868 invoked from network); 11 Oct 2002 01:04:58 -0000 Date: Thu, 10 Oct 2002 21:04:54 -0400 From: Clint Adams To: zsh-workers@sunsite.dk Subject: PATCH: cap leak Message-ID: <20021011010454.GA14519@dman.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Virus-Scanned: by amavisd-milter (http://amavis.org/) 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 -----