Commit a8529d8b authored by Daniel Salzman's avatar Daniel Salzman

knotc: fix return codes for memstats

parent ecf04aad
......@@ -771,24 +771,26 @@ static int cmd_memstats(int argc, char *argv[], unsigned flags)
process_error,
&est);
if (loader == NULL) {
rc = 1;
log_zone_error("Could not load zone.\n");
hattrie_apply_rev(est.node_table, estimator_free_trie_node, NULL);
hattrie_apply_rev(est.dname_table, estimator_free_trie_node, NULL);
hattrie_free(est.node_table);
hattrie_free(est.dname_table);
return KNOT_ERROR;
break;
}
/* Do a parser run, but do not actually create the zone. */
int ret = file_loader_process(loader);
if (ret != KNOT_EOK) {
rc = 1;
log_zone_error("Failed to parse zone.\n");
hattrie_apply_rev(est.node_table, estimator_free_trie_node, NULL);
hattrie_apply_rev(est.dname_table, estimator_free_trie_node, NULL);
hattrie_free(est.node_table);
hattrie_free(est.dname_table);
file_loader_free(loader);
return KNOT_ERROR;
break;
}
/* Only size of ahtables inside trie's nodes is missing. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment