From a5da4bbca53db25fb060876cee4ea633eea4e54f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 23 Aug 2022 11:13:56 +0200 Subject: [PATCH] libmount: (owner) remove if-before-free Signed-off-by: Karel Zak --- libmount/src/hook_owner.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libmount/src/hook_owner.c b/libmount/src/hook_owner.c index fc5981da1d..f23ef536c6 100644 --- a/libmount/src/hook_owner.c +++ b/libmount/src/hook_owner.c @@ -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; } -- 2.47.3