tests: fix leaks spotted by ASAN

Always allocate from open_blob_rw(), to simplify memory management.

The fixes are not exhaustive.

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Marc-André Lureau 2023-02-28 11:31:00 +04:00 committed by David Gibson
parent 6f8b28f496
commit 083ab26da8
10 changed files with 25 additions and 21 deletions

View file

@ -32,6 +32,7 @@ static void *open_dt(char *path)
* Resize our DTs to 4k so that we have room to operate on
*/
CHECK(fdt_open_into(dt, copy, FDT_COPY_SIZE));
free(dt);
return copy;
}