summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--mico-store.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/mico-store.c b/mico-store.c
index ade4788..fec55bd 100644
--- a/mico-store.c
+++ b/mico-store.c
@@ -244,7 +244,16 @@ main(int argc, char *argv[])
 
 		// note that data must be kept in memory until zip_close
 		// actually writes the archive.
+
+		// close and reopen the zip to force write and free all buffers
+		zip_close(zip);
+		zip = zip_open(argv[1], 0, 0);
+		if (!zip)
+			exit(-1);
+
 		arrfree(metrics[m].value);
+		free(ts.mem);
+		free(vs.mem);
 	}
 
 	zip_close(zip);