Fix memory leak in ztest
This is tripping LeakSanitizer, which causes zloop test failures on pull requests. Reviewed-by: Tino Reichardt <milky-zfs@mcmilk.de> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu> Closes #14583
This commit is contained in:
parent
b79e7114bb
commit
bc4d210783
|
@ -4639,8 +4639,11 @@ ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t id)
|
|||
* Destroy the previous batch of objects, create a new batch,
|
||||
* and do some I/O on the new objects.
|
||||
*/
|
||||
if (ztest_object_init(zd, od, size, B_TRUE) != 0)
|
||||
if (ztest_object_init(zd, od, size, B_TRUE) != 0) {
|
||||
zd->zd_od = NULL;
|
||||
umem_free(od, size);
|
||||
return;
|
||||
}
|
||||
|
||||
while (ztest_random(4 * batchsize) != 0)
|
||||
ztest_io(zd, od[ztest_random(batchsize)].od_object,
|
||||
|
|
Loading…
Reference in New Issue