From 4b5f6510f262ce30daf3d3ce3f1e36d3dd5a8159 Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Fri, 12 Jul 2013 09:14:20 -0700 Subject: [PATCH] http://code.google.com/p/libarchive/issues/detail?id=325 Close the file handle on error. --- cpio/cpio.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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 -- 2.47.2