summaryrefslogtreecommitdiff
path: root/cmds-subvolume.c
diff options
context:
space:
mode:
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>2013-12-12 18:41:07 +0800
committerChris Mason <clm@fb.com>2014-01-31 08:22:17 -0800
commit3cae13ee934311b438ea15e773bc5c7d965d1cd8 (patch)
tree35ac1175f20ba9a6b317e2f40d93ee639d389942 /cmds-subvolume.c
parente3c9596d3fc8b0df647a6cbae55c2d77570de759 (diff)
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 <guihc.fnst@cn.fujitsu.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'cmds-subvolume.c')
-rw-r--r--cmds-subvolume.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/cmds-subvolume.c b/cmds-subvolume.c
index c6a5284a..255f0281 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;
}