summaryrefslogtreecommitdiffstats
path: root/lib/yang.c
diff options
context:
space:
mode:
authorChristian Hopps <chopps@labn.net>2024-02-14 23:31:12 +0100
committerChristian Hopps <chopps@labn.net>2024-02-15 12:13:08 +0100
commitb8e07049a8ee684eaa8df48bef6e7bfbc853644d (patch)
tree0a4531ad463e758d10dd983d401c6d23a8760294 /lib/yang.c
parentMerge pull request #15332 from donaldsharp/nhg_stuffs (diff)
downloadfrr-b8e07049a8ee684eaa8df48bef6e7bfbc853644d.tar.xz
frr-b8e07049a8ee684eaa8df48bef6e7bfbc853644d.zip
lib: fix memleak on success
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/yang.c')
-rw-r--r--lib/yang.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/yang.c b/lib/yang.c
index ff7df0b37..8a2abfaf0 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -730,9 +730,9 @@ LY_ERR yang_parse_notification(LYD_FORMAT format, const char *data,
err = lyd_parse_op(ly_native_ctx, NULL, in, format, LYD_TYPE_NOTIF_YANG,
&tree, NULL);
+ ly_in_free(in, 0);
if (err) {
zlog_err("Failed to parse notification: %s", ly_last_errmsg());
- ly_in_free(in, 0);
return err;
}
@@ -751,7 +751,6 @@ LY_ERR yang_parse_notification(LYD_FORMAT format, const char *data,
if (!found) {
zlog_err("Notification not found in the parsed tree");
lyd_free_all(tree);
- ly_in_free(in, 0);
return LY_ENOTFOUND;
}