]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libfdisk: fix possible memory leak [clang-analyze]
authorKarel Zak <kzak@redhat.com>
Tue, 1 Jul 2014 11:36:37 +0000 (13:36 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 1 Jul 2014 11:36:37 +0000 (13:36 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/label.c

index 3881a2713731a74a2962d77ca8ddb6e6531ed4f3..f2cc255cdd4e670f1b4df028b6498f7d1ecda952 100644 (file)
@@ -153,6 +153,8 @@ int fdisk_get_columns(struct fdisk_context *cxt, int all, int **cols, size_t *nc
        }
        if (cols)
                *cols = c;
+       else
+               free(c);
        if (ncols)
                *ncols = n;
        return 0;