Skip to content

Commit

Permalink
libmount: fix possible memory leak
Browse files Browse the repository at this point in the history
Signed-off-by: Karel Zak <kzak@redhat.com>
  • Loading branch information
karelzak committed May 2, 2024
1 parent 3c92af3 commit 7756e23
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions libmount/src/context_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 7756e23

Please sign in to comment.