Permalink
Browse files

http://code.google.com/p/libarchive/issues/detail?id=325

Close the file handle on error.
  • Loading branch information...
1 parent 2bc28c7 commit 4b5f6510f262ce30daf3d3ce3f1e36d3dd5a8159 @kientzle kientzle committed Jul 12, 2013
Showing with 3 additions and 1 deletion.
  1. +3 −1 cpio/cpio.c
View
@@ -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

0 comments on commit 4b5f651

Please sign in to comment.