summaryrefslogtreecommitdiffstats
path: root/cmd/zfs
diff options
context:
space:
mode:
authorcao <[email protected]>2016-09-30 03:11:44 +0800
committerBrian Behlendorf <[email protected]>2016-09-29 12:11:44 -0700
commit9ec0403d6acd3ab362905b74c5db6aaf31c71f47 (patch)
tree041cafe2f8e4b64fbadd7e3fda8347c11c445d9b /cmd/zfs
parentc9d61adbf8f422fe8d3bda45d9de9e82c757d0b0 (diff)
Fix coverity defects: CID 147610, 147608, 147607
coverity scan CID:147610, Type: Resource leak. coverity scan CID:147608, Type: Resource leak. coverity scan CID:147607, Type: Resource leak. Reviewed-by: Richard Laager <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: cao.xuewen <[email protected]> Closes #5143
Diffstat (limited to 'cmd/zfs')
-rw-r--r--cmd/zfs/zfs_main.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/cmd/zfs/zfs_main.c b/cmd/zfs/zfs_main.c
index 301e2957e..a4ffb1f44 100644
--- a/cmd/zfs/zfs_main.c
+++ b/cmd/zfs/zfs_main.c
@@ -6700,9 +6700,10 @@ zfs_do_diff(int argc, char **argv)
if ((atp = strchr(copy, '@')))
*atp = '\0';
- if ((zhp = zfs_open(g_zfs, copy, ZFS_TYPE_FILESYSTEM)) == NULL)
+ if ((zhp = zfs_open(g_zfs, copy, ZFS_TYPE_FILESYSTEM)) == NULL) {
+ free(copy);
return (1);
-
+ }
free(copy);
/*