index 57e9ddffc770041e134a670897c8036fa001ca6e..1eb7aecee0cade45c59f34a001d110caaa26093e 100644 (file)
--- a/src/liboconfig/parser.y
+++ b/src/liboconfig/parser.y
entire_file:
statement_list
{
- ci_root = malloc (sizeof (*ci_root));
- memset (ci_root, '\0', sizeof (*ci_root));
+ ci_root = calloc (1, sizeof (*ci_root));
ci_root->children = $1.statement;
ci_root->children_num = $1.statement_num;
}
| /* epsilon */
{
- ci_root = malloc (sizeof (*ci_root));
- memset (ci_root, '\0', sizeof (*ci_root));
+ ci_root = calloc (1, sizeof (*ci_root));
ci_root->children = NULL;
ci_root->children_num = 0;
}