device_tree: Fix potential memory leak

cppcheck error report:

device_tree.c:156: error: Memory leak: dupname

Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
Stefan Weil 2011-10-17 22:12:09 +02:00 committed by Stefan Hajnoczi
parent d300854b1c
commit bff39b6360

View File

@ -153,6 +153,7 @@ int qemu_devtree_add_subnode(void *fdt, const char *name)
int retval;
if (!basename) {
g_free(dupname);
return -1;
}