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@redhat.com>
Acked-by: Pavel Grunt <pgrunt@redhat.com>
This commit is contained in:
Uri Lublin 2017-06-06 15:10:22 +03:00
parent 94725f1ca8
commit 8e593b55cf

View File

@ -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) {