summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2023-10-15 18:39:06 +0200
committerLeah Neukirchen <leah@vuxu.org>2023-10-15 18:39:06 +0200
commit54ab34df86362785200e69d39f3b1fb5ee6cdce3 (patch)
tree0e9565dadff6de3793f67819b246ecb00621383c
parent65c4ebf3102f9970b18c3dd0445f1128f1f683f9 (diff)
downloadmico-54ab34df86362785200e69d39f3b1fb5ee6cdce3.tar.gz
mico-54ab34df86362785200e69d39f3b1fb5ee6cdce3.tar.xz
mico-54ab34df86362785200e69d39f3b1fb5ee6cdce3.zip
mico-store: reload zip to do partial write
-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);