Most other OVS libraries' delete and uninitialization functions allow a
null argument, but this one would cause a segfault.

Signed-off-by: Justin Pettit <jpet...@ovn.org>
---
 ofproto/ofproto-dpif-xlate-cache.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ofproto/ofproto-dpif-xlate-cache.c 
b/ofproto/ofproto-dpif-xlate-cache.c
index d319d287eadb..24fc769a7a0d 100644
--- a/ofproto/ofproto-dpif-xlate-cache.c
+++ b/ofproto/ofproto-dpif-xlate-cache.c
@@ -279,6 +279,9 @@ xlate_cache_clear(struct xlate_cache *xcache)
 void
 xlate_cache_uninit(struct xlate_cache *xcache)
 {
+    if (!xcache) {
+        return;
+    }
     xlate_cache_clear(xcache);
     ofpbuf_uninit(&xcache->entries);
 }
-- 
2.7.4

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

Reply via email to