From 3cae13ee934311b438ea15e773bc5c7d965d1cd8 Mon Sep 17 00:00:00 2001 From: Gui Hecheng Date: Thu, 12 Dec 2013 18:41:07 +0800 Subject: btrfs-progs: remove NULL-ptr judge before free for btrfs-progs free(3) already checks the pointer for NULL, no need to do it on your own. This patch make the change globally. Signed-off-by: Gui Hecheng Signed-off-by: David Sterba Signed-off-by: Chris Mason --- cmds-subvolume.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) (limited to 'cmds-subvolume.c') diff --git a/cmds-subvolume.c b/cmds-subvolume.c index c6a5284..255f028 100644 --- a/cmds-subvolume.c +++ b/cmds-subvolume.c @@ -949,22 +949,16 @@ static int cmd_subvol_show(int argc, char **argv) 1, raw_prefix); /* clean up */ - if (get_ri.path) - free(get_ri.path); - if (get_ri.name) - free(get_ri.name); - if (get_ri.full_path) - free(get_ri.full_path); - if (filter_set) - btrfs_list_free_filter_set(filter_set); + free(get_ri.path); + free(get_ri.name); + free(get_ri.full_path); + btrfs_list_free_filter_set(filter_set); out: close_file_or_dir(fd, dirstream1); close_file_or_dir(mntfd, dirstream2); - if (mnt) - free(mnt); - if (fullpath) - free(fullpath); + free(mnt); + free(fullpath); return !!ret; } -- cgit v1.2.1