From: Nathan Wagner Date: Mon, 26 Nov 2018 08:55:57 +0000 (+0000) Subject: improve note memory handling X-Git-Tag: v0.3.0~18 X-Git-Url: https://pd.if.org/git/?p=zpackage;a=commitdiff_plain;h=5cc943f078123837c33a4eeebf6eb96a581ddb47 improve note memory handling --- 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; }