projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
oconfig: fix oconfig_free to free all elements
[collectd.git]
/
src
/
liboconfig
/
oconfig.c
diff --git
a/src/liboconfig/oconfig.c
b/src/liboconfig/oconfig.c
index
629775a
..
181eadd
100644
(file)
--- a/
src/liboconfig/oconfig.c
+++ b/
src/liboconfig/oconfig.c
@@
-187,7
+187,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 (oconfig_item_t *ci)
+void oconfig_free
_all
(oconfig_item_t *ci)
{
int i;
{
int i;
@@
-206,12
+206,19
@@
void oconfig_free (oconfig_item_t *ci)
free (ci->values);
for (i = 0; i < ci->children_num; i++)
free (ci->values);
for (i = 0; i < ci->children_num; i++)
- oconfig_free (ci->children + i);
+ oconfig_free
_all
(ci->children + i);
if (ci->children != NULL)
free (ci->children);
}
if (ci->children != NULL)
free (ci->children);
}
+void oconfig_free (oconfig_item_t *ci)
+{
+ oconfig_free_all (ci);
+ free (ci);
+ ci = NULL;
+}
+
/*
* vim:shiftwidth=2:tabstop=8:softtabstop=2:fdm=marker
*/
/*
* vim:shiftwidth=2:tabstop=8:softtabstop=2:fdm=marker
*/