From: Tim Kientzle Date: Fri, 12 Jul 2013 16:14:20 +0000 (-0700) Subject: http://code.google.com/p/libarchive/issues/detail?id=325 X-Git-Tag: v3.1.900a~368^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b5f6510f262ce30daf3d3ce3f1e36d3dd5a8159;p=thirdparty%2Flibarchive.git http://code.google.com/p/libarchive/issues/detail?id=325 Close the file handle on error. --- diff --git a/cpio/cpio.c b/cpio/cpio.c index 6f57d95d6..3889290af 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -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