diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/zfs-tests/cmd/draid.c | 5 | ||||
-rw-r--r-- | tests/zfs-tests/cmd/mkfile.c | 4 |
2 files changed, 8 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 diff --git a/tests/zfs-tests/cmd/mkfile.c b/tests/zfs-tests/cmd/mkfile.c index 7ce50e6a3..3b61deed6 100644 --- a/tests/zfs-tests/cmd/mkfile.c +++ b/tests/zfs-tests/cmd/mkfile.c @@ -276,5 +276,9 @@ main(int argc, char **argv) argv++; argc--; } + + if (buf) + free(buf); + return (errors); } |