]> granicus.if.org Git - shadow/commitdiff
* lib/tcbfuncs.c: Do not free path before its last use.
authornekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 18 Mar 2010 00:02:17 +0000 (00:02 +0000)
committernekral-guest <nekral-guest@5a98b0ae-9ef6-0310-add3-de5d479b70d7>
Thu, 18 Mar 2010 00:02:17 +0000 (00:02 +0000)
ChangeLog
lib/tcbfuncs.c

index 6951d965d65b34d3740ee343786103fe8f84eb29..78b3f62d576ec593584f21ac552508f777fc8a02 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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@centraliens.net>
 
index 2c00a3a3bb3e26196619466922e8d2e3c4eaa285..9afe6468032ba45f0c4c0a54ce0a6d861bd70c6b 100644 (file)
@@ -126,11 +126,12 @@ static char *shadowtcb_path_rel_existing(const char *name)
                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);