From: Karel Zak Date: Wed, 4 Jan 2023 11:35:27 +0000 (+0100) Subject: libmount: fix memory leak [coverity scan] X-Git-Tag: v2.39-rc1~213 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c4d70c6989982020288b1432fcf17dd165770383;p=thirdparty%2Futil-linux.git libmount: fix memory leak [coverity scan] Signed-off-by: Karel Zak --- diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 938d34f8d4..1c1b6f77c6 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -78,8 +78,10 @@ static int fix_optstr(struct libmnt_context *cxt) if (!name) rc = -ENOMEM; - else + else { rc = mnt_opt_set_value(opt, name); + free(name); + } if (rc) goto done; }