Skip to content

Commit dad0a3c

Browse files
authored
Merge pull request #569 from ADTRAN/parsing-sub-modules-dangling-pointer
Fix dangling parsing_sub_modules pointer
2 parents 027e933 + 71e2424 commit dad0a3c

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/parser_yang.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,6 +2630,10 @@ yang_read_module(struct ly_ctx *ctx, const char* data, unsigned int size, const
26302630
ret = yang_parse_mem(module, NULL, unres, data, size, &node);
26312631
if (ret == -1) {
26322632
if (ly_vecode(ctx) == LYVE_SUBMODULE) {
2633+
/* Remove this module from the list of processed modules,
2634+
as we're about to free it */
2635+
lyp_check_circmod_pop(ctx);
2636+
26332637
free(module);
26342638
module = NULL;
26352639
} else {

0 commit comments

Comments
 (0)