[Pkg-shadow-commits] r3127 - in upstream/trunk: . lib

Nicolas FRANÇOIS nekral-guest at alioth.debian.org
Thu Mar 18 00:02:24 UTC 2010


Author: nekral-guest
Date: 2010-03-18 00:02:17 +0000 (Thu, 18 Mar 2010)
New Revision: 3127

Modified:
   upstream/trunk/ChangeLog
   upstream/trunk/lib/tcbfuncs.c
Log:
	* lib/tcbfuncs.c: Do not free path before its last use.

Modified: upstream/trunk/ChangeLog
===================================================================
--- upstream/trunk/ChangeLog	2010-03-18 00:02:02 UTC (rev 3126)
+++ upstream/trunk/ChangeLog	2010-03-18 00:02:17 UTC (rev 3127)
@@ -10,6 +10,7 @@
 	* lib/tcbfuncs.c: Avoid implicit conversion of pointers or
 	integers to booleans.
 	* lib/tcbfuncs.c: Avoid assignments in comparisons.
+	* lib/tcbfuncs.c: Do not free path before its last use.
 
 2010-03-17  Nicolas François  <nicolas.francois at centraliens.net>
 

Modified: upstream/trunk/lib/tcbfuncs.c
===================================================================
--- upstream/trunk/lib/tcbfuncs.c	2010-03-18 00:02:02 UTC (rev 3126)
+++ upstream/trunk/lib/tcbfuncs.c	2010-03-18 00:02:17 UTC (rev 3127)
@@ -126,11 +126,12 @@
 		return NULL;
 	}
 	ret = readlink(path, link, sizeof(link) - 1);
-	free(path);
 	if (ret == -1) {
 		fprintf(stderr, _("%s: Cannot read symbolic link %s: %s\n"), Prog, path, strerror(errno));
+		free(path);
 		return NULL;
 	}
+	free(path);
 	if (ret >= sizeof(link) - 1) {
 		link[sizeof(link) - 1] = '\0';
 		fprintf(stderr, _("%s: Suspiciously long symlink: %s\n"), Prog, link);




More information about the Pkg-shadow-commits mailing list