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 <[email protected]> --- lib/netlink-socket.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/netlink-socket.c b/lib/netlink-socket.c index 5cb1fc89a..976ed15e8 100644 --- a/lib/netlink-socket.c +++ b/lib/netlink-socket.c @@ -232,6 +232,7 @@ nl_sock_create(int protocol, struct nl_sock **sockp) } /* Obtain pid assigned by kernel. */ + memset(&local, 0, sizeof local); local_size = sizeof local; if (getsockname(sock->fd, (struct sockaddr *) &local, &local_size) < 0) { VLOG_ERR("getsockname: %s", ovs_strerror(errno)); -- 2.43.5 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
