projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.5'
[collectd.git]
/
src
/
liboconfig
/
oconfig.c
diff --git
a/src/liboconfig/oconfig.c
b/src/liboconfig/oconfig.c
index
d01c79d
..
cfe9c5a
100644
(file)
--- a/
src/liboconfig/oconfig.c
+++ b/
src/liboconfig/oconfig.c
@@
-106,13
+106,12
@@
oconfig_item_t *oconfig_clone (const oconfig_item_t *ci_orig)
{
oconfig_item_t *ci_copy;
{
oconfig_item_t *ci_copy;
- ci_copy =
(oconfig_item_t *) malloc (
sizeof (*ci_copy));
+ ci_copy =
calloc (1,
sizeof (*ci_copy));
if (ci_copy == NULL)
{
if (ci_copy == NULL)
{
- fprintf (stderr, "
m
alloc failed.\n");
+ fprintf (stderr, "
c
alloc failed.\n");
return (NULL);
}
return (NULL);
}
- memset (ci_copy, 0, sizeof (*ci_copy));
ci_copy->values = NULL;
ci_copy->parent = NULL;
ci_copy->children = NULL;
ci_copy->values = NULL;
ci_copy->parent = NULL;
ci_copy->children = NULL;
@@
-177,7
+176,7
@@
oconfig_item_t *oconfig_clone (const oconfig_item_t *ci_orig)
for (i = 0; i < ci_copy->children_num; i++)
{
oconfig_item_t *child;
for (i = 0; i < ci_copy->children_num; i++)
{
oconfig_item_t *child;
-
+
child = oconfig_clone (ci_orig->children + i);
if (child == NULL)
{
child = oconfig_clone (ci_orig->children + i);
if (child == NULL)
{
@@
-193,7
+192,7
@@
oconfig_item_t *oconfig_clone (const oconfig_item_t *ci_orig)
return (ci_copy);
} /* oconfig_item_t *oconfig_clone */
return (ci_copy);
} /* oconfig_item_t *oconfig_clone */
-void oconfig_free_all (oconfig_item_t *ci)
+
static
void oconfig_free_all (oconfig_item_t *ci)
{
int i;
{
int i;
@@
-222,7
+221,6
@@
void oconfig_free (oconfig_item_t *ci)
{
oconfig_free_all (ci);
free (ci);
{
oconfig_free_all (ci);
free (ci);
- ci = NULL;
}
/*
}
/*