Clang reports possible null pointer 'lflows' passed to qsort.
This is due to the checker unable to make sure whether 'lflows'
gets malloc or not in the previous loop.  Thus, fix it by adding
ovs_assert to pass clang checker.

Signed-off-by: William Tu <u9012...@gmail.com>
---
 ovn/utilities/ovn-sbctl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/ovn/utilities/ovn-sbctl.c b/ovn/utilities/ovn-sbctl.c
index 7af5863b08fc..b1f106002842 100644
--- a/ovn/utilities/ovn-sbctl.c
+++ b/ovn/utilities/ovn-sbctl.c
@@ -860,6 +860,7 @@ cmd_lflow_list(struct ctl_context *ctx)
         lflows[n_flows] = lflow;
         n_flows++;
     }
+    ovs_assert(lflows);
     qsort(lflows, n_flows, sizeof *lflows, lflow_cmp);
 
     bool print_uuid = shash_find(&ctx->options, "--uuid") != NULL;
-- 
2.7.4

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to