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

PATCH: 3.1.6-pws-2: cap_free



I've finally compiled on a system with POSIX capability sets.  This one
definitely needs cap_free to get the value returned from cap_get_proc, not
a pointer to it.  If there are implementations which do this the other way,
we have problems.

You can test this if you also have --enable-zsh-mem --enable-zsh-mem-debug,
because you get a bad free warning from e.g. `print -P "%#"'.

--- Src/utils.c.cap	Mon Aug  2 09:24:34 1999
+++ Src/utils.c	Tue Aug 31 13:29:26 1999
@@ -3633,10 +3633,10 @@
 	    for(n = 0; !cap_get_flag(caps, n, CAP_EFFECTIVE, &val); n++)
 		if(val ||
 		   (!cap_get_flag(caps, n, CAP_INHERITABLE, &val) && val)) {
-		    cap_free(&caps);
+		    cap_free(caps);
 		    return 1;
 		}
-	    cap_free(&caps);
+	    cap_free(caps);
 	}
     }
 #endif /* HAVE_CAP_GET_PROC */

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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