Skip to content

Commit ee33108

Browse files
authored
Merge pull request #480 from mohitarora24/patch-1
Memory Leak Fix - Instance Identifier Value inserted into dictionary twice
2 parents 9da7ae9 + 5ab2f8d commit ee33108

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/parser.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,6 +1830,10 @@ lyp_parse_value(struct lys_type *type, const char **value_, struct lyxml_elem *x
18301830
LOGVAL(LYE_INMETA, LY_VLOG_LYD, contextnode, "<none>", itemname, *value_);
18311831
}
18321832
goto cleanup;
1833+
} else if (value == *value_) {
1834+
/* we have actually created the same expression (prefixes are the same as the module names)
1835+
* so we have just increased dictionary's refcount - fix it */
1836+
lydict_remove(type->parent->module->ctx, value);
18331837
}
18341838
} else if (dflt) {
18351839
/* turn logging off */

0 commit comments

Comments
 (0)