From 5cc943f078123837c33a4eeebf6eb96a581ddb47 Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Mon, 26 Nov 2018 08:55:57 +0000 Subject: [PATCH] improve note memory handling --- lib/notes.c | 1 + zpm-note.c | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/notes.c b/lib/notes.c index 9622bae..b337fd4 100644 --- a/lib/notes.c +++ b/lib/notes.c @@ -87,6 +87,7 @@ void zpm_note_free(struct zpm_note *n) { free(n->pkgid); free(n->path); free(n->file); + n->note = n->pkgid = n->path = n->file = 0; } int zpm_notes_available(struct zpm *zpm, int flags) { diff --git a/zpm-note.c b/zpm-note.c index 33e7fa2..927f30a 100644 --- a/zpm-note.c +++ b/zpm-note.c @@ -106,8 +106,5 @@ int main(int ac, char **av){ } fail = pkg.error; zpm_close(&pkg); - if (n.id) { - zpm_note_free(&n); - } return fail ? EXIT_FAILURE : EXIT_SUCCESS; } -- 2.40.0