diff mbox

[5/5] btrfs-progs: fix minor leak of dev_info in btrfs_scan_kernel

Message ID f8a24717b11fa5501ade5c76077584f771b005c1.1419951036.git.dsterba@suse.cz (mailing list archive)
State Accepted
Headers show

Commit Message

David Sterba Dec. 30, 2014, 2:57 p.m. UTC
Resolves-coverity-id: 1127098
Signed-off-by: David Sterba <dsterba@suse.cz>
---
 cmds-filesystem.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox

Patch

diff --git a/cmds-filesystem.c b/cmds-filesystem.c
index 1c1d34ae8ca2..a3cf114fb6ac 100644
--- a/cmds-filesystem.c
+++ b/cmds-filesystem.c
@@ -516,8 +516,10 @@  static int btrfs_scan_kernel(void *search)
 			continue;
 		ret = get_fs_info(mnt->mnt_dir, &fs_info_arg,
 				&dev_info_arg);
-		if (ret)
+		if (ret) {
+			kfree(dev_info_arg);
 			goto out;
+		}
 
 		if (get_label_mounted(mnt->mnt_dir, label)) {
 			kfree(dev_info_arg);