diff options
| author | Donatas Abraitis <donatas@opensourcerouting.org> | 2024-01-10 12:16:37 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-10 12:16:37 +0200 |
| commit | 4c875482a5097288a0fa20fc91c079c93e98c0d3 (patch) | |
| tree | e30705a18073f36158f1f0559787d7cf43393311 /lib/northbound_oper.c | |
| parent | 22b439090cdef4525cae767e80d6898a3de5c6e4 (diff) | |
| parent | 5519c0fbe6d01b108ee09c82079f6a228cb0d23f (diff) | |
Merge pull request #15123 from LabNConsulting/chopps/fix-oper-state-memleak
lib: fix oper-state memleak
Diffstat (limited to 'lib/northbound_oper.c')
| -rw-r--r-- | lib/northbound_oper.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/northbound_oper.c b/lib/northbound_oper.c index 78106e4e45..b5201c6306 100644 --- a/lib/northbound_oper.c +++ b/lib/northbound_oper.c @@ -480,7 +480,7 @@ static enum nb_error nb_op_ys_init_node_infos(struct nb_op_yield_state *ys) { struct nb_op_node_info *ni; struct lyd_node_inner *inner; - struct lyd_node *node; + struct lyd_node *node = NULL; enum nb_error ret; uint i, len; char *tmp; @@ -550,6 +550,8 @@ static enum nb_error nb_op_ys_init_node_infos(struct nb_op_yield_state *ys) darr_foreach_i (ys->node_infos, i) { ret = nb_op_ys_finalize_node_info(ys, i); if (ret != NB_OK) { + if (ys->node_infos[0].inner) + lyd_free_all(&ys->node_infos[0].inner->node); darr_free(ys->node_infos); return ret; } |
