| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 8/9] xfsdump: children[] is an array of child pointers, not of child structures |
| From: | Eric Sandeen <sandeen@xxxxxxxxxx> |
| Date: | Wed, 12 Nov 2014 12:57:17 -0600 |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1415818638-32700-1-git-send-email-sandeen@xxxxxxxxxx> |
| References: | <1415818638-32700-1-git-send-email-sandeen@xxxxxxxxxx> |
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@xxxxxxxxxx>
---
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
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 7/9] xfsdump: free allocated persistent paths, Eric Sandeen |
|---|---|
| Next by Date: | Re: [PATCH 2/9] xfsdump: Fix overflow of "question" string in Media_prompt_erase(), Christoph Hellwig |
| Previous by Thread: | [PATCH 7/9] xfsdump: free allocated persistent paths, Eric Sandeen |
| Next by Thread: | Fwd: multiple processes hanging doing xfs ops -- 3.17.2, L Walsh |
| Indexes: | [Date] [Thread] [Top] [All Lists] |