CLIgen pt_expand API change and mem problems

This commit is contained in:
Olof hagsand 2020-05-20 12:00:52 +02:00
parent 7d0b245174
commit 1a1aa58249
3 changed files with 12 additions and 13 deletions

View file

@ -17,6 +17,6 @@ See [LICENSE.md](LICENSE.md) for the license.
Clixon interaction is best done posting issues, pull requests, or joining the
[slack channel](https://clixondev.slack.com).
[Slack invite](https://join.slack.com/t/clixondev/shared_invite/enQtMzI3OTM4MzA3Nzk3LTA3NWM4OWYwYWMxZDhiYTNhNjRkNjQ1NWI1Zjk5M2JjMDk4MTUzMTljYTZiYmNhODkwMDI2ZTkyNWU3ZWMyN2U).
[Slack invite](https://join.slack.com/t/clixondev/shared_invite/zt-egqe8bqt-JSQL49otf2B9MzKSoUoRQg).
Clixon is sponsored by [Rubicon Communications LLC(Netgate)](https://www.netgate.com/)

View file

@ -428,7 +428,6 @@ usage(clicon_handle h,
exit(-1);
}
int
main(int argc,
char **argv)

View file

@ -321,16 +321,16 @@ cli_load_syntax_file(clicon_handle h,
return -1;
}
else {
for (i = 0; i < nvec; i++) {
if (syntax_append(h,
cli_syntax(h),
vec[i],
pt) < 0) {
goto done;
for (i = 0; i < nvec; i++) {
if (syntax_append(h,
cli_syntax(h),
vec[i],
pt) < 0) {
goto done;
}
if (prompt)
cli_set_prompt(h, vec[i], prompt);
}
if (prompt)
cli_set_prompt(h, vec[i], prompt);
}
}
cligen_parsetree_free(pt, 1);
@ -577,7 +577,7 @@ clicon_parse(clicon_handle h,
if (cliread_parse(cli_cligen(h), cmd, pt, &match_obj, cvv, result, &reason) < 0)
goto done;
if (*result != CG_MATCH)
pt_expand_cleanup_1(pt); /* XXX change to pt_expand_treeref_cleanup */
pt_expand_cleanup(pt); /* XXX change to pt_expand_treeref_cleanup */
if (modename0){
cligen_tree_active_set(cli_cligen(h), modename0);
modename0 = NULL;
@ -597,7 +597,7 @@ clicon_parse(clicon_handle h,
}
if ((r = clicon_eval(h, cmd, match_obj, cvv)) < 0)
cli_handler_err(stdout);
pt_expand_cleanup_1(pt); /* XXX change to pt_expand_treeref_cleanup */
pt_expand_cleanup(pt); /* XXX change to pt_expand_treeref_cleanup */
if (evalres)
*evalres = r;
break;