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.4' into collectd-5.5
[collectd.git]
/
src
/
liboconfig
/
oconfig.c
diff --git
a/src/liboconfig/oconfig.c
b/src/liboconfig/oconfig.c
index
539c9d3
..
f422f5a
100644
(file)
--- a/
src/liboconfig/oconfig.c
+++ b/
src/liboconfig/oconfig.c
@@
-33,6
+33,7
@@
#include "oconfig.h"
extern FILE *yyin;
#include "oconfig.h"
extern FILE *yyin;
+extern int yyparse (void);
oconfig_item_t *ci_root;
const char *c_file;
oconfig_item_t *ci_root;
const char *c_file;
@@
-195,7
+196,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;
@@
-214,12
+215,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
*/