Skip to content

Commit 9959f3e

Browse files
committed
xpath BUGFIX memory leak
1 parent 7a9e87f commit 9959f3e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/xpath.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ cast_string_recursive(struct lyd_node *node, struct lys_module *local_mod, int f
456456
line = strtok_r(buf, "\n", &ptr);
457457
do {
458458
if (cast_string_realloc(local_mod->ctx, indent * 2 + strlen(line) + 1, str, used, size)) {
459+
free(buf);
459460
return -1;
460461
}
461462
memset(*str + (*used - 1), ' ', indent * 2);

0 commit comments

Comments
 (0)