- ci_root = malloc (sizeof (oconfig_item_t));
- memset (ci_root, '\0', sizeof (oconfig_item_t));
- ci_root->children = NULL;
- ci_root->children_num = 0;
+ ci_root = calloc(1, sizeof(*ci_root));
+ if (ci_root == NULL) {
+ yyerror("calloc failed");
+ YYERROR;
+ }