index 539c9d3533ec5b3a29e5bb32f0227f2e0f4ac910..5d2c5b2afa7a7907b6a2e3139fcf7357f563f0ae 100644 (file)
--- a/src/liboconfig/oconfig.c
+++ b/src/liboconfig/oconfig.c
#include "oconfig.h"
extern FILE *yyin;
+extern int yyparse (void);
oconfig_item_t *ci_root;
const char *c_file;
yyset_in (fh);
if (NULL == c_file) {
- int status;
-
status = snprintf (file, sizeof (file), "<fd#%d>", fileno (fh));
if ((status < 0) || (status >= sizeof (file))) {
return (ci_copy);
} /* oconfig_item_t *oconfig_clone */
-void oconfig_free (oconfig_item_t *ci)
+static void oconfig_free_all (oconfig_item_t *ci)
{
int 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);
}
+void oconfig_free (oconfig_item_t *ci)
+{
+ oconfig_free_all (ci);
+ free (ci);
+ ci = NULL;
+}
+
/*
* vim:shiftwidth=2:tabstop=8:softtabstop=2:fdm=marker
*/