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

index fef33b044f0328bf75231fff677d2b3b85813fc0..e8f00608391b07ee2ff6c6065b414de601411831 100644 (file)
@@ -280,6 +280,7 @@ static int fstrim_all_from_file(struct fstrim_control *ctl, const char *filename
                        mnt_unref_fs(fs);
                        fs = NULL;
                }
+               free(rootdev);
        }
 
        itr = mnt_new_iter(MNT_ITER_BACKWARD);