mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 09:55:56 +00:00
lib: fix memleak on success
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit b8e07049a8
)
This commit is contained in:
parent
6c86e3a59c
commit
ca30662b7f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user