aboutsummaryrefslogtreecommitdiffstats
path: root/tests/zfs-tests/cmd/draid.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/zfs-tests/cmd/draid.c')
-rw-r--r--tests/zfs-tests/cmd/draid.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/zfs-tests/cmd/draid.c b/tests/zfs-tests/cmd/draid.c
index 869ca902d..39b58a709 100644
--- a/tests/zfs-tests/cmd/draid.c
+++ b/tests/zfs-tests/cmd/draid.c
@@ -720,8 +720,11 @@ eval_maps(uint64_t children, int passes, uint64_t *map_seed,
*/
error = alloc_new_map(children, MAP_ROWS_DEFAULT,
vdev_draid_rand(map_seed), &map);
- if (error)
+ if (error) {
+ if (best_map != NULL)
+ free_map(best_map);
return (error);
+ }
/*
* Consider maps with a lower worst_ratio to be of higher