]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
http://code.google.com/p/libarchive/issues/detail?id=325
authorTim Kientzle <kientzle@acm.org>
Fri, 12 Jul 2013 16:14:20 +0000 (09:14 -0700)
committerTim Kientzle <kientzle@acm.org>
Fri, 12 Jul 2013 16:14:20 +0000 (09:14 -0700)
Close the file handle on error.

cpio/cpio.c

index 6f57d95d616ec821388d418e29b85e5ad0d26850..3889290afc53b92baaedcc59a8749313d4950442 100644 (file)
@@ -1235,8 +1235,10 @@ cpio_rename(const char *name)
        if (t == NULL)
                return (name);
        to = fopen("CONOUT$", "w");
-       if (to == NULL)
+       if (to == NULL) {
+               fclose(t);
                return (name);
+       }
        fprintf(to, "%s (Enter/./(new name))? ", name);
        fclose(to);
 #else