[Spice-commits] 2 commits - server/reds.c server/tests

Frediano Ziglio fziglio at kemper.freedesktop.org
Mon Dec 11 10:16:52 UTC 2017


 server/reds.c              |    1 +
 server/tests/test-stream.c |    1 +
 2 files changed, 2 insertions(+)

New commits:
commit ee87a36e9546de6ed7632a0c747514934133d74c
Author: Uri Lublin <uril at redhat.com>
Date:   Sun Dec 10 13:05:18 2017 +0200

    test-stream: initialize msg.msg_flags
    
    Coverity complains the field is not initialized.
    That's true but man recvmsg specifies that this
    field is set by recvmsg.
    
    To make coverity happy, initialize this field.
    
    Signed-off-by: Uri Lublin <uril at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/tests/test-stream.c b/server/tests/test-stream.c
index ef5d607e..d56109d1 100644
--- a/server/tests/test-stream.c
+++ b/server/tests/test-stream.c
@@ -66,6 +66,7 @@ sock_fd_read(int sock, void *buf, ssize_t bufsize, int *fd)
         msg.msg_iovlen = 1;
         msg.msg_control = cmsgu.control;
         msg.msg_controllen = sizeof(cmsgu.control);
+        msg.msg_flags = 0;
         size = recvmsg(sock, &msg, 0);
         if (size < 0) {
             perror ("recvmsg");
commit 1a16419431d6465ec0dd5f856802cf7710dd3162
Author: Uri Lublin <uril at redhat.com>
Date:   Sun Dec 10 13:05:16 2017 +0200

    reds_init_socket: do not leak slisten on error
    
    Found by Coverity.
    
    Signed-off-by: Uri Lublin <uril at redhat.com>
    Acked-by: Frediano Ziglio <fziglio at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 325af5e8..e7b95980 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2588,6 +2588,7 @@ static int reds_init_socket(const char *addr, int portnr, int family)
         len = SUN_LEN(&local);
         if (bind(slisten, (struct sockaddr *)&local, len) == -1) {
             perror("bind");
+            close(slisten);
             return -1;
         }
 


More information about the Spice-commits mailing list