summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2015-06-07 01:28:06 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2015-06-07 01:28:06 +0200
commit3552b9e1fb529c64f4c1eabaac38d2ce2d30c0db (patch)
tree006e84513f75d16893323c7e13b3b153d88167cf
parent394b54992600342dddb86a39952771155739669f (diff)
downloadxK-3552b9e1fb529c64f4c1eabaac38d2ce2d30c0db.tar.gz
xK-3552b9e1fb529c64f4c1eabaac38d2ce2d30c0db.tar.xz
xK-3552b9e1fb529c64f4c1eabaac38d2ce2d30c0db.zip
degesch: fix memory leak
-rw-r--r--degesch.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/degesch.c b/degesch.c
index eaa772c..7d1c074 100644
--- a/degesch.c
+++ b/degesch.c
@@ -5437,6 +5437,14 @@ config_dump_children
static void
config_dump_item (struct config_item_ *item, struct config_dump_data *data)
{
+ // Empty objects will show as such
+ if (item->type == CONFIG_ITEM_OBJECT
+ && item->value.object.len)
+ {
+ config_dump_children (item, data);
+ return;
+ }
+
struct str line;
str_init (&line);
@@ -5449,14 +5457,6 @@ config_dump_item (struct config_item_ *item, struct config_dump_data *data)
for (; iter; iter = iter->next)
str_append_printf (&line, ".%s", iter->name);
- // Empty objects will show as such
- if (item->type == CONFIG_ITEM_OBJECT
- && item->value.object.len)
- {
- config_dump_children (item, data);
- return;
- }
-
// Don't bother writing out null values everywhere
struct config_schema *schema = item->schema;
bool has_default = schema && schema->default_;