summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Pankov <yuri.pankov@nexenta.com>2017-01-13 09:06:59 -0800
committerMatthew Ahrens <mahrens@delphix.com>2017-01-13 10:18:20 -0800
commit105686550ee9cbf5d033166a8a2a5a763667d436 (patch)
treec763eb577b0922ef9cfee675f3297af434ca6aa9
parentf5fb56de308f70aaa788d3921c1177fad4183232 (diff)
downloadillumos-joyent-105686550ee9cbf5d033166a8a2a5a763667d436.tar.gz
7730 libzfs`add_config() leaks config nvl when reading spare/l2cache devices
Reviewed by: Matthew Ahrens <mahrens@delphix.com> Reviewed by: Serapheim Dimitropoulos <serapheim@delphix.com> Approved by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/lib/libzfs/common/libzfs_import.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr/src/lib/libzfs/common/libzfs_import.c b/usr/src/lib/libzfs/common/libzfs_import.c
index b73a71e94c..3b6a6d468e 100644
--- a/usr/src/lib/libzfs/common/libzfs_import.c
+++ b/usr/src/lib/libzfs/common/libzfs_import.c
@@ -237,9 +237,12 @@ add_config(libzfs_handle_t *hdl, pool_list_t *pl, const char *path,
free(ne);
return (-1);
}
+
ne->ne_guid = vdev_guid;
ne->ne_next = pl->names;
pl->names = ne;
+
+ nvlist_free(config);
return (0);
}