[Spice-commits] 2 commits - server/red-replay-qxl.c server/reds.c

Uri Lublin uril at kemper.freedesktop.org
Wed Jul 19 17:02:10 UTC 2017


 server/red-replay-qxl.c |    1 +
 server/reds.c           |    5 +++--
 2 files changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8e593b55cf28566d46687f25802ac6aa24ca8302
Author: Uri Lublin <uril at redhat.com>
Date:   Tue Jun 6 15:10:22 2017 +0300

    init ssl connection: return quickly if link is null
    
    Under error: 'link' fields are being accessed, so it's
    wrong to goto error with link == NULL.
    
    Instead, return immediately.
    
    Found by coverity.
    
    Signed-off-by: Uri Lublin <uril at redhat.com>
    Acked-by: Pavel Grunt <pgrunt at redhat.com>

diff --git a/server/reds.c b/server/reds.c
index 034cd10d..8abfbda5 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2461,8 +2461,9 @@ static RedLinkInfo *reds_init_client_ssl_connection(RedsState *reds, int socket)
     int ssl_status;
 
     link = reds_init_client_connection(reds, socket);
-    if (link == NULL)
-        goto error;
+    if (link == NULL) {
+        return NULL;
+    }
 
     ssl_status = reds_stream_enable_ssl(link->stream, reds->ctx);
     switch (ssl_status) {
commit 94725f1ca84713dd239daae92067f2979d2ba48f
Author: Uri Lublin <uril at redhat.com>
Date:   Tue Jun 6 15:00:11 2017 +0300

    red_replay_image_free: do not free QUIC qxl twice
    
    If qxl->descriptor.type is QUIC, red_replay_data_chunks_free
    frees qxl (data), so no need to free it again at the bottom
    of the function.
    
    Found by coverity.
    
    Signed-off-by: Uri Lublin <uril at redhat.com>
    Acked-by: Pavel Grunt <pgrunt at redhat.com>

diff --git a/server/red-replay-qxl.c b/server/red-replay-qxl.c
index 3c0f528b..6172ed22 100644
--- a/server/red-replay-qxl.c
+++ b/server/red-replay-qxl.c
@@ -523,6 +523,7 @@ static void red_replay_image_free(SpiceReplay *replay, QXLPHYSICAL p, uint32_t f
         break;
     case SPICE_IMAGE_TYPE_QUIC:
         red_replay_data_chunks_free(replay, qxl, 0);
+        qxl = NULL;
         break;
     default:
         spice_warn_if_reached();


More information about the Spice-commits mailing list