diff --git a/tools/zipdir/zipdir.c b/tools/zipdir/zipdir.c index 4cb98c138..dab0dac04 100644 --- a/tools/zipdir/zipdir.c +++ b/tools/zipdir/zipdir.c @@ -781,6 +781,8 @@ void write_zip(const char *zipname, dir_tree_t *trees, int update) if (central_dir == NULL) { fprintf(stderr, "Could not read central directory from %s. (Is it a zipfile?)\n", zipname); + fclose(ozip); + ozip = NULL; update = 0; } }