summaryrefslogtreecommitdiff
path: root/lib/northbound_cli.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@nvidia.com>2021-02-17 17:01:06 -0500
committerQuentin Young <qlyoung@nvidia.com>2021-02-17 17:01:06 -0500
commit4da4b9d4f1e1a820909ec502e79b6c9ef2ed8dec (patch)
tree3af9aa7511a439a0c0dc9ba38a5b04ec97e46f67 /lib/northbound_cli.c
parent95e336226e64aee0db909ce6d1ae2db9cbcb0901 (diff)
lib: fix some misc SA warnings
- clippy.c: fix valid memleak - defun_lex.l: suppress warnings in generated code - northbound_cli.c: suppress warning in eldritch libyang macro Signed-off-by: Quentin Young <qlyoung@nvidia.com>
Diffstat (limited to 'lib/northbound_cli.c')
-rw-r--r--lib/northbound_cli.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/northbound_cli.c b/lib/northbound_cli.c
index ad7dad5cb2..1416b758d8 100644
--- a/lib/northbound_cli.c
+++ b/lib/northbound_cli.c
@@ -600,7 +600,19 @@ void nb_cli_show_dnode_cmds(struct vty *vty, struct lyd_node *root,
(*nb_node->cbs.cli_show_end)(vty, parent);
}
+ /*
+ * There is a possible path in this macro that ends up
+ * dereferencing child->parent->parent. We just null checked
+ * child->parent by checking (ly_iter_next_up(child) != NULL)
+ * above.
+ *
+ * I am not sure whether it is possible for the other
+ * conditions within this macro guarding the problem
+ * dereference to be satisfied when child->parent == NULL.
+ */
+#ifndef __clang_analyzer__
LY_TREE_DFS_END(root, next, child);
+#endif
}
}