reds_init_socket: do not leak slisten on error

Found by Coverity.

Signed-off-by: Uri Lublin <uril@redhat.com>
Acked-by: Frediano Ziglio <fziglio@redhat.com>
This commit is contained in:
Uri Lublin 2017-12-10 13:05:16 +02:00 committed by Frediano Ziglio
parent 7ff434b104
commit 1a16419431

View File

@ -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;
}