diff options
| author | Christian Hopps <chopps@labn.net> | 2024-02-14 17:31:12 -0500 |
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-02-15 18:03:50 +0000 |
| commit | ca30662b7f964863ed0814ed9e2330dcd15b17e6 (patch) | |
| tree | bc3a8f769c8478c973014a97a6a3613afa578c2c | |
| parent | 6c86e3a59ca3a85fa0be33ac8089accdaabbde74 (diff) | |
lib: fix memleak on success
Signed-off-by: Christian Hopps <chopps@labn.net>
(cherry picked from commit b8e07049a8ee684eaa8df48bef6e7bfbc853644d)
| -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; } |
