]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
dmesg: fix possible memory leak [coverity scan]
authorKarel Zak <kzak@redhat.com>
Thu, 10 Jun 2021 11:44:25 +0000 (13:44 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 10 Jun 2021 11:44:25 +0000 (13:44 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/dmesg.c

index ba9a749b2eddc79c4fc37281e1785fe26d5f3cb1..b3b9ef786ed3099dbb05b12ed7ec68a40cde1f57 100644 (file)
@@ -1085,10 +1085,10 @@ full_output:
                        mesg_size = strlen(line);
                        goto full_output;
                }
-               free(mesg_copy);
        }
 
 done:
+       free(mesg_copy);
        putchar('\n');
 }