[Spice-devel] [spice-server PATCH 3/3] init ssl connection: return quickly if link is null

Uri Lublin uril at redhat.com
Sun Jul 16 15:47:54 UTC 2017


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>
---
 server/reds.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/server/reds.c b/server/reds.c
index f412a8486..46d33fb5f 100644
--- a/server/reds.c
+++ b/server/reds.c
@@ -2462,7 +2462,7 @@ static RedLinkInfo *reds_init_client_ssl_connection(RedsState *reds, int socket)
 
     link = reds_init_client_connection(reds, socket);
     if (link == NULL)
-        goto error;
+        return NULL;
 
     ssl_status = reds_stream_enable_ssl(link->stream, reds->ctx);
     switch (ssl_status) {
-- 
2.13.3



More information about the Spice-devel mailing list