From ad84aaaa6cfdd9bd3aaec774abbf868faaa35b5b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 Sep 2011 15:32:35 +0200 Subject: [PATCH] libmount: redundant null check on calling free() [smatch scan] Signed-off-by: Karel Zak --- libmount/src/context.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libmount/src/context.c b/libmount/src/context.c index 22102607eb..e3158e48f8 100644 --- a/libmount/src/context.c +++ b/libmount/src/context.c @@ -1259,8 +1259,7 @@ int mnt_context_prepare_helper(struct libmnt_context *cxt, const char *name, if (rc) continue; - if (cxt->helper) - free(cxt->helper); + free(cxt->helper); cxt->helper = strdup(helper); if (!cxt->helper) return -ENOMEM; -- 2.47.3