From 06cf4d989058a65f72b140d85e2c21effd3b3834 Mon Sep 17 00:00:00 2001 From: cao Date: Thu, 13 Oct 2016 02:16:47 +0800 Subject: Fix coverity defects: CID 147606, 147609 coverity scan CID:147606, Type:resource leak coverity scan CID:147609, Type:resource leak Reviewed-by: Brian Behlendorf Signed-off-by: cao.xuewen Closes #5245 --- cmd/ztest/ztest.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd/ztest') diff --git a/cmd/ztest/ztest.c b/cmd/ztest/ztest.c index 1491e8734..2e4dae3a9 100644 --- a/cmd/ztest/ztest.c +++ b/cmd/ztest/ztest.c @@ -6281,8 +6281,11 @@ ztest_run(ztest_shared_t *zs) kthread_t *thread; if (t < ztest_opts.zo_datasets && - ztest_dataset_open(t) != 0) + ztest_dataset_open(t) != 0) { + umem_free(tid, + ztest_opts.zo_threads * sizeof (kt_did_t)); return; + } VERIFY3P(thread = zk_thread_create(NULL, 0, (thread_func_t)ztest_thread, -- cgit v1.2.3