]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libmount: (owner) remove if-before-free
authorKarel Zak <kzak@redhat.com>
Tue, 23 Aug 2022 09:13:56 +0000 (11:13 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 3 Jan 2023 11:58:42 +0000 (12:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
libmount/src/hook_owner.c

index fc5981da1d1cd0e8b893ef471f15d6c33d3726cf..f23ef536c65f95c838d08e2ca7d69dd982eb51cd 100644 (file)
@@ -33,8 +33,7 @@ static int hookset_deinit(struct libmnt_context *cxt, const struct libmnt_hookse
 
        /* remove all our hooks and free hook data */
        while (mnt_context_remove_hook(cxt, hs, 0, &data) == 0) {
-               if (data)
-                       free(data);
+               free(data);
                data = NULL;
        }