summaryrefslogtreecommitdiff
path: root/tests/appendprop2.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2023-02-28 11:31:00 +0400
committerDavid Gibson <david@gibson.dropbear.id.au>2023-03-01 18:43:15 +1100
commit083ab26da83bf5d14df5733e3b9954a0881f9ecc (patch)
tree3843b7ceaf95f6fa78f5fc70cd9c4327211950da /tests/appendprop2.c
parent6f8b28f496093156ae126b434ed753094943da03 (diff)
downloaddevice-tree-compiler-083ab26da83bf5d14df5733e3b9954a0881f9ecc.tar.gz
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>
Diffstat (limited to 'tests/appendprop2.c')
-rw-r--r--tests/appendprop2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/appendprop2.c b/tests/appendprop2.c
index a0c1f6f..a96c88a 100644
--- a/tests/appendprop2.c
+++ b/tests/appendprop2.c
@@ -36,6 +36,7 @@ int main(int argc, char *argv[])
buf = xmalloc(SPACE);
CHECK(fdt_open_into(fdt, buf, SPACE));
+ free(fdt);
fdt = buf;
CHECK(fdt_appendprop(fdt, 0, "prop-bytes", bytes, sizeof(bytes)));