degesch: fix memory leak
This commit is contained in:
parent
394b549926
commit
3552b9e1fb
16
degesch.c
16
degesch.c
|
@ -5437,6 +5437,14 @@ config_dump_children
|
||||||
static void
|
static void
|
||||||
config_dump_item (struct config_item_ *item, struct config_dump_data *data)
|
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;
|
struct str line;
|
||||||
str_init (&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)
|
for (; iter; iter = iter->next)
|
||||||
str_append_printf (&line, ".%s", iter->name);
|
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
|
// Don't bother writing out null values everywhere
|
||||||
struct config_schema *schema = item->schema;
|
struct config_schema *schema = item->schema;
|
||||||
bool has_default = schema && schema->default_;
|
bool has_default = schema && schema->default_;
|
||||||
|
|
Loading…
Reference in New Issue