[PATCH 8/9] xfsdump: children[] is an array of child pointers, not of child structures
Eric Sandeen
sandeen at redhat.com
Wed Nov 12 12:57:17 CST 2014
node_t **children; /* child nodes */
so allocating space to hold nbr_children structures is wrong;
we need to hold nbr_children _pointers_ to child structures.
It's over-allocating, so it's relatively harmless.
Signed-off-by: Eric Sandeen <sandeen at redhat.com>
---
invutil/list.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/invutil/list.c b/invutil/list.c
index 0157102..599e6af 100644
--- a/invutil/list.c
+++ b/invutil/list.c
@@ -34,7 +34,7 @@ parent_add_child(node_t *parent, node_t *child)
d = parent->data;
d->nbr_children++;
- d->children = realloc(d->children, d->nbr_children * sizeof(*child));
+ d->children = realloc(d->children, d->nbr_children * sizeof(node_t *));
d->children[d->nbr_children - 1] = child;
return parent;
--
1.7.1
More information about the xfs
mailing list