diff --git a/flattree.c b/flattree.c index ec14954..089b976 100644 --- a/flattree.c +++ b/flattree.c @@ -797,6 +797,10 @@ static struct node *unflatten_tree(struct inbuf *dtbuf, } } while (val != FDT_END_NODE); + if (node->name != flatname) { + free(flatname); + } + return node; }