summaryrefslogtreecommitdiffstats
path: root/lib/yang.c
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2020-12-09 13:57:28 +0100
committerRafael Zalamena <rzalamena@opensourcerouting.org>2020-12-09 13:57:28 +0100
commit4e32d023cdf9fc5326b09ea6aa16d465bc948147 (patch)
tree19842270dd483aee22fdcc3c2e91ed638b8d7981 /lib/yang.c
parentlib: silently ignore duplicated values (diff)
downloadfrr-4e32d023cdf9fc5326b09ea6aa16d465bc948147.tar.xz
frr-4e32d023cdf9fc5326b09ea6aa16d465bc948147.zip
lib: prevent libyang abstraction memory leak
Call `ly_set_free()` on `YANG_ITER_STOP` as well. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'lib/yang.c')
-rw-r--r--lib/yang.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/yang.c b/lib/yang.c
index 22fe938e4..a3e2a395d 100644
--- a/lib/yang.c
+++ b/lib/yang.c
@@ -468,7 +468,7 @@ void yang_dnode_iterate(yang_dnode_iter_cb cb, void *arg,
dnode = set->set.d[i];
ret = (*cb)(dnode, arg);
if (ret == YANG_ITER_STOP)
- return;
+ break;
}
ly_set_free(set);