zsh-workers
 help / color / mirror / code / Atom feed
From: Clint Adams <clint@zsh.org>
To: zsh-workers@sunsite.dk
Subject: PATCH: cap leak
Date: Thu, 10 Oct 2002 21:04:54 -0400	[thread overview]
Message-ID: <20021011010454.GA14519@dman.com> (raw)

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 -----


                 reply	other threads:[~2002-10-11  1:05 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20021011010454.GA14519@dman.com \
    --to=clint@zsh.org \
    --cc=zsh-workers@sunsite.dk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).