From: Karel Zak Date: Thu, 2 May 2024 08:15:29 +0000 (+0200) Subject: libmount: fix possible memory leak X-Git-Tag: v2.42-start~357 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7756e234ca34dcd489985b28c2e7b126c330342a;p=thirdparty%2Futil-linux.git libmount: fix possible memory leak Signed-off-by: Karel Zak --- diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c index 478a9fde4..f9d610f77 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -546,9 +546,10 @@ static int do_mount(struct libmnt_context *cxt, const char *try_type) cxt->syscall_status = 0; } - if (org_type && rc != 0) + if (org_type && rc != 0) { __mnt_fs_set_fstype_ptr(cxt->fs, org_type); - org_type = NULL; + org_type = NULL; + } if (rc == 0 && try_type && cxt->update) { struct libmnt_fs *fs = mnt_update_get_fs(cxt->update);