[Crosstoolchain-logs] [device-tree-compiler] 185/198: DTC: Fix memory leak on flatname.

Hector Oron zumbi at moszumanska.debian.org
Thu Dec 8 17:07:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

zumbi pushed a commit to branch upstream/1.4.x
in repository device-tree-compiler.

commit cb9241ae345378b7193b3d7c9621e8abe657faa6
Author: Jean-Christophe Dubois <jcd at tribudubois.net>
Date:   Mon Jul 11 00:16:52 2016 +0200

    DTC: Fix memory leak on flatname.
    
    If flatname was not referenced by the "node" structure, the reference to the
    allocated string is lost at function exit.
    
    We need to free it if is not used by "node".
    
    Signed-off-by: Jean-Christophe Dubois <jcd at tribudubois.net>
    Signed-off-by: David Gibson <david at gibson.dropbear.id.au>
---
 flattree.c | 4 ++++
 1 file changed, 4 insertions(+)

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;
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/crosstoolchain/device-tree-compiler.git



More information about the Crosstoolchain-logs mailing list