Coverity says:

CID 1042350 (#1 of 1): Uninitialized scalar variable (UNINIT)
23. uninit_use_in_call: Using uninitialized value "ling": field 
"ling"."l_linger" is uninitialized when calling "setsockopt(int, int, int, void 
const *, socklen_t)".

Signed-off-by: Mikko Rapeli <[email protected]>
---
 trinity.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/trinity.c b/trinity.c
index 93e7819..3f80020 100644
--- a/trinity.c
+++ b/trinity.c
@@ -250,6 +250,7 @@ cleanup_fds:
 
        for (i = 0; i < nr_sockets; i++) {
                struct linger ling;
+               memset(&ling, 0, sizeof(ling));
 
                ling.l_onoff = FALSE;   /* linger active */
                setsockopt(shm->socket_fds[i], SOL_SOCKET, SO_LINGER, &ling, 
sizeof(struct linger));
-- 
1.8.3.1

--
To unsubscribe from this list: send the line "unsubscribe trinity" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to