Fixed if-feature-expr parser memory leak

Make test go directly to docker/main
This commit is contained in:
Olof hagsand 2022-06-26 12:27:01 +02:00
parent a00e36caa2
commit 19b210b1b6
3 changed files with 9 additions and 4 deletions

View file

@ -207,7 +207,7 @@ example: checkinstall util warnroot
# Run a clixon test container.
# Alt: cd test; ./all.sh
test:
(cd docker && $(MAKE) $(MFLAGS) test)
$(MAKE) -C docker $(MFLAGS) $@
docker:
for i in docker; \

View file

@ -62,8 +62,7 @@ distclean: clean
do (cd $$i; $(MAKE) $(MFLAGS) $@); done
test:
for i in $(SUBDIRS); \
do (cd $$i; $(MAKE) $(MFLAGS) $@); done
$(MAKE) -C main $(MFLAGS) $@
depend:
for i in $(SUBDIRS); \

View file

@ -115,6 +115,8 @@ clixon_if_feature_parseerror(void *arg,
}
/*! Check if feature "str" is enabled or not in context of yang node ys
* @param[in] str feature str.
* @param[in] ys If-feature type yang node
*/
static int
if_feature_check(char *str,
@ -198,7 +200,11 @@ iffactor : NOT sep1 iffactor { _PARSE_DEBUG("factor-> NOT sep factor");
| TOKEN {
_PARSE_DEBUG("factor->TOKEN");
if (_IF->if_ys == NULL) $$ = 0;
else if (($$ = if_feature_check($1, _IF->if_ys)) < 0) YYERROR;
else if (($$ = if_feature_check($1, _IF->if_ys)) < 0) {
free($1);
YYERROR;
}
free($1);
}
;