DORMANTno replies

[PATCH] dtc: zero out new label objects

From: Stephen Warren <hidden>
Date: 2012-09-28 18:39:22
Subsystem: the rest · Maintainer: Linus Torvalds

From: Stephen Warren <redacted>

Without this, new->deleted may be left set to some random value, which
may then cause future label references to fail to locate the label. The
code that allocates properties and nodes already contains the equivalent
memset().

Signed-off-by: Stephen Warren <redacted>
---
 livetree.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/livetree.c b/livetree.c
index e856662..b61465f 100644
--- a/livetree.c
+++ b/livetree.c
@@ -36,6 +36,7 @@ void add_label(struct label **labels, char *label)
 		}
 
 	new = xmalloc(sizeof(*new));
+	memset(new, 0, sizeof(*new));
 	new->label = label;
 	new->next = *labels;
 	*labels = new;
-- 
1.7.0.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help