]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: make sure we use NULL after free
authorKarel Zak <kzak@redhat.com>
Tue, 28 Jan 2020 11:29:44 +0000 (12:29 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 28 Jan 2020 11:29:44 +0000 (12:29 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/context.c

index 743a6bc1d2328cca9f59ba6700c79ed368f239eb..efbd80c1a204911ee690f97a1886ee6958e5c890 100644 (file)
@@ -1042,6 +1042,7 @@ void fdisk_unref_context(struct fdisk_context *cxt)
                                cxt->labels[i]->op->free(cxt->labels[i]);
                        else
                                free(cxt->labels[i]);
+                       cxt->labels[i] = NULL;
                }
 
                fdisk_unref_context(cxt->parent);