The Clang analyzer will alert on the use of uninitialized variable local
despite the fact that this should be set by a syscall.

To suppress the warning, this variable is now initialized.

Signed-off-by: Mike Pattrick <m...@redhat.com>
---
 lib/netlink-socket.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c
index 5cb1fc89a..737e49cfc 100644
--- a/lib/netlink-socket.c
+++ b/lib/netlink-socket.c
@@ -233,6 +233,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp)
 
     /* Obtain pid assigned by kernel. */
     local_size = sizeof local;
+    local.nl_family = AF_UNSPEC;
     if (getsockname(sock->fd, (struct sockaddr *) &local, &local_size) < 0) {
         VLOG_ERR("getsockname: %s", ovs_strerror(errno));
         goto error;
-- 
2.43.5

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

Reply via email to