summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6bd48f2)
raw | patch | inline | side by side (parent: 6bd48f2)
author | Wilfried Goesgens <dothebart@citadel.org> | |
Thu, 5 Jun 2014 18:04:13 +0000 (20:04 +0200) | ||
committer | Marc Fournier <marc.fournier@camptocamp.com> | |
Fri, 20 Jun 2014 14:53:50 +0000 (16:53 +0200) |
This fixes https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=750440
src/configfile.c | patch | blob | history |
diff --git a/src/configfile.c b/src/configfile.c
index 0b7786f929605a311b4c8705a48e73a80ace68b4..983d99569796fde8b684242663106357e3506d3d 100644 (file)
--- a/src/configfile.c
+++ b/src/configfile.c
/* Resize the memory containing the children to be big enough to hold
* all children. */
+ if (dst->children_num + src->children_num - 1 == 0)
+ {
+ dst->children_num = 0;
+ return (0);
+ }
+
temp = (oconfig_item_t *) realloc (dst->children,
sizeof (oconfig_item_t)
* (dst->children_num + src->children_num - 1));
continue;
/* Now replace the i'th child in `root' with `new'. */
- cf_ci_replace_child (root, new, i);
+ if (cf_ci_replace_child (root, new, i) < 0)
+ return (-1);
/* ... and go back to the new i'th child. */
--i;