fix: move free after error message that needs data.
authorjbj <devnull@localhost>
Thu, 30 Mar 2000 19:21:09 +0000 (19:21 +0000)
committerjbj <devnull@localhost>
Thu, 30 Mar 2000 19:21:09 +0000 (19:21 +0000)
CVS patchset: 3644
CVS date: 2000/03/30 19:21:09

build.c

diff --git a/build.c b/build.c
index ac3fd87..bef9776 100644 (file)
--- a/build.c
+++ b/build.c
@@ -171,14 +171,15 @@ static int buildForTarget(const char *arg, struct rpmBuildArguments *ba,
        sprintf(s, "%s/%s", specDir, cmd);
        res = rename(tmpSpecFile, s);
        xfree(specDir);
-       xfree(tmpSpecFile);
        
        if (res) {
            fprintf(stderr, _("Failed to rename %s to %s: %s\n"),
                    tmpSpecFile, s, strerror(errno));
            unlink(tmpSpecFile);
+           xfree(tmpSpecFile);
            return 1;
        }
+       xfree(tmpSpecFile);
 
        /* Make the directory which contains the tarball the source 
           directory for this run */