summaryrefslogtreecommitdiffstats
path: root/sys-utils/umount.c
diff options
context:
space:
mode:
authorKarel Zak2014-07-17 15:12:35 +0200
committerKarel Zak2014-07-17 15:12:35 +0200
commit86c58c4a8201251bd0083d0af8cda4e5610efa48 (patch)
tree7d7f4e4ba4dfa73358d23bfa4f295a65ef50dae8 /sys-utils/umount.c
parentfstrim: fix memory leak [coverity scan] (diff)
downloadkernel-qcow2-util-linux-86c58c4a8201251bd0083d0af8cda4e5610efa48.tar.gz
kernel-qcow2-util-linux-86c58c4a8201251bd0083d0af8cda4e5610efa48.tar.xz
kernel-qcow2-util-linux-86c58c4a8201251bd0083d0af8cda4e5610efa48.zip
umount: fix memory leak [coverity scan]
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'sys-utils/umount.c')
-rw-r--r--sys-utils/umount.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys-utils/umount.c b/sys-utils/umount.c
index a75ff9ec1..8bc6655ea 100644
--- a/sys-utils/umount.c
+++ b/sys-utils/umount.c
@@ -445,8 +445,10 @@ static int umount_alltargets(struct libmnt_context *cxt, const char *spec, int r
/* get on @cxt independent mountinfo */
tb = new_mountinfo(cxt);
- if (!tb)
- return MOUNT_EX_SOFTWARE;
+ if (!tb) {
+ rc = MOUNT_EX_SOFTWARE;
+ goto done;
+ }
/* Note that @fs is from mount context and the context will be reseted
* after each umount() call */
@@ -468,6 +470,7 @@ static int umount_alltargets(struct libmnt_context *cxt, const char *spec, int r
break;
}
+done:
mnt_free_iter(itr);
mnt_unref_table(tb);