[Spice-devel] [server PATCH 1/4] reds_init_socket: do not leak slisten on error
Frediano Ziglio
fziglio at redhat.com
Mon Dec 11 09:17:08 UTC 2017
>
> Found by coverity.
>
> Signed-off-by: Uri Lublin <uril at redhat.com>
> ---
> server/reds.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/server/reds.c b/server/reds.c
> index 325af5e8b..e7b95980a 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;
> }
>
Acked-by: Frediano Ziglio <fziglio at redhat.com>
Just a small suggestion, "Coverity" with capital.
I remember time ago Coverity was asking to put some reference to the
case if open source but I think this is enough.
Frediano
More information about the Spice-devel
mailing list