]> pd.if.org Git - zpackage/commitdiff
improve note memory handling
authorNathan Wagner <nw@hydaspes.if.org>
Mon, 26 Nov 2018 08:55:57 +0000 (08:55 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Mon, 26 Nov 2018 08:55:57 +0000 (08:55 +0000)
lib/notes.c
zpm-note.c

index 9622baebc399aa4dee62803db1d7db57a29f86bb..b337fd446756a320330519e6f6bfaa7a3a48eea1 100644 (file)
@@ -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) {
index 33e7fa2a923b03de0779fefac186fa14798ca8d6..927f30a45b8443ed6c93f92a25ae2061fdef35c7 100644 (file)
@@ -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;
 }