libmount: fix memory leak on error [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
parent
f11eedf527
commit
cb400752a4
|
@ -574,9 +574,10 @@ static int evaluate_permissions(struct libmnt_context *cxt)
|
||||||
|
|
||||||
curr_user = mnt_get_username(getuid());
|
curr_user = mnt_get_username(getuid());
|
||||||
|
|
||||||
if (!mnt_context_switch_ns(cxt, ns_old))
|
if (!mnt_context_switch_ns(cxt, ns_old)) {
|
||||||
|
free(curr_user);
|
||||||
return -MNT_ERR_NAMESPACE;
|
return -MNT_ERR_NAMESPACE;
|
||||||
|
}
|
||||||
if (!curr_user) {
|
if (!curr_user) {
|
||||||
DBG(CXT, ul_debugobj(cxt, "umount %s: cannot "
|
DBG(CXT, ul_debugobj(cxt, "umount %s: cannot "
|
||||||
"convert %d to username", tgt, getuid()));
|
"convert %d to username", tgt, getuid()));
|
||||||
|
|
Loading…
Reference in New Issue