diff options
| author | Christian Hopps <chopps@labn.net> | 2024-02-14 17:31:12 -0500 |
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2024-02-15 06:13:08 -0500 |
| commit | b8e07049a8ee684eaa8df48bef6e7bfbc853644d (patch) | |
| tree | 0a4531ad463e758d10dd983d401c6d23a8760294 /lib/yang.c | |
| parent | 2fd5e51d4cb0949ce46f131a59f6cc916e3b5240 (diff) | |
lib: fix memleak on success
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/yang.c')
| -rw-r--r-- | lib/yang.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/yang.c b/lib/yang.c index ff7df0b379..8a2abfaf01 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; } |
