about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2002-10-11 01:08:18 +0000
committerClint Adams <clint@users.sourceforge.net>2002-10-11 01:08:18 +0000
commit6c998a07abd19822efd77d6fd6d919464d68ba44 (patch)
treea9528e308476ed6c68daefaec19c885c56615a6b
parent7a0ab2444d96365a7aec2c55a4e470513d8e4a10 (diff)
downloadzsh-6c998a07abd19822efd77d6fd6d919464d68ba44.tar.gz
zsh-6c998a07abd19822efd77d6fd6d919464d68ba44.tar.xz
zsh-6c998a07abd19822efd77d6fd6d919464d68ba44.zip
* 17810 (Martin Waitz): Src/utils.c: bung up memory leak with
  POSIX.1e capabilities.
-rw-r--r--ChangeLog5
-rw-r--r--Src/utils.c5
2 files changed, 9 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index fbed00bbc..55ed61207 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2002-10-10  Clint Adams  <clint@zsh.org>
+
+	* 17810 (Martin Waitz): Src/utils.c: bung up memory leak with
+	POSIX.1e capabilities.
+
 2002-10-10  Oliver Kiddle  <opk@zsh.org>
 
 	* 17794: Src/builtin.c, Src/params.c: fix bugs with tied parameters
diff --git a/Src/utils.c b/Src/utils.c
index e5050ac79..a043c101f 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -3677,7 +3677,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);
 	}
     }