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

Frediano Ziglio fziglio at redhat.com
Mon Jul 17 08:17:40 UTC 2017


> 
> On Sun, 2017-07-16 at 18:47 +0300, Uri Lublin wrote:
> > 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>
> > ---
> >  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) {

Patch is fine. Could you update the style (brackets) ?

Frediano


More information about the Spice-devel mailing list