Browse Source

dtc: zero out new label objects

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 <swarren@nvidia.com>
main
Stephen Warren 12 years ago committed by Jon Loeliger
parent
commit
317a5d92bc
  1. 1
      livetree.c

1
livetree.c

@ -36,6 +36,7 @@ void add_label(struct label **labels, char *label) @@ -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;

Loading…
Cancel
Save