CLIgen mem leak, test augment

This commit is contained in:
Olof hagsand 2021-11-05 14:43:28 +01:00
parent 9daa214b3e
commit a1fe080111
2 changed files with 39 additions and 1 deletions

View file

@ -651,7 +651,7 @@ clicon_parse(clicon_handle h,
cli_syntax_t *stx = NULL;
cli_syntaxmode_t *csm;
parse_tree *pt; /* Orig */
cg_obj *match_obj;
cg_obj *match_obj = NULL;
cvec *cvv = NULL;
FILE *f;
char *reason = NULL;
@ -731,6 +731,8 @@ done:
free(reason);
if (cvv)
cvec_free(cvv);
if (match_obj)
co_free(match_obj, 0);
return retval;
}