Free fn after error message, not before.
authorjbj <devnull@localhost>
Wed, 9 Aug 2000 16:49:10 +0000 (16:49 +0000)
committerjbj <devnull@localhost>
Wed, 9 Aug 2000 16:49:10 +0000 (16:49 +0000)
CVS patchset: 4047
CVS date: 2000/08/09 16:49:10

build/files.c

index ad2f132..7a73c2e 100644 (file)
@@ -1224,7 +1224,6 @@ static int processPackageFiles(Spec spec, Package pkg,
                "/", pkg->fileFile, NULL);
        }
        fd = Fopen(ffn, "r.fpio");
-       xfree(ffn);
 
        if (fd == NULL || Ferror(fd)) {
            rpmError(RPMERR_BADFILENAME,
@@ -1232,6 +1231,8 @@ static int processPackageFiles(Spec spec, Package pkg,
                ffn, Fstrerror(fd));
            return RPMERR_BADFILENAME;
        }
+       xfree(ffn);
+
        while (fgets(buf, sizeof(buf), (FILE *)fdGetFp(fd))) {
            handleComments(buf);
            if (expandMacros(spec, spec->macros, buf, sizeof(buf))) {