Do not leak memory if the program argument `l` got passed more than once. Found by clang-analyzer. Signed-off-by: Christian Göttsche <cgzones@xxxxxxxxxxxxxx> --- libselinux/utils/getconlist.c | 1 + 1 file changed, 1 insertion(+) diff --git a/libselinux/utils/getconlist.c b/libselinux/utils/getconlist.c index 76654b75..0bb28469 100644 --- a/libselinux/utils/getconlist.c +++ b/libselinux/utils/getconlist.c @@ -26,6 +26,7 @@ int main(int argc, char **argv) while ((opt = getopt(argc, argv, "l:")) > 0) { switch (opt) { case 'l': + free(level); level = strdup(optarg); if (!level) { fprintf(stderr, "memory allocation failure: %d(%s)\n", -- 2.31.1