Commit 5e82fba1 authored by Kir Kolyshkin's avatar Kir Kolyshkin Committed by Pavel Emelyanov

open_inet_sk(): don't leak socket fd on error

Reported by Coverity, CID 51628.
Signed-off-by: 's avatarKir Kolyshkin <kir@openvz.org>
Acked-by: 's avatarAndrew Vagin <avagin@odin.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent c6e724f6
...@@ -501,7 +501,7 @@ static int open_inet_sk(struct file_desc *d) ...@@ -501,7 +501,7 @@ static int open_inet_sk(struct file_desc *d)
if (ie->v6only) { if (ie->v6only) {
if (restore_opt(sk, SOL_IPV6, IPV6_V6ONLY, &yes) == -1) if (restore_opt(sk, SOL_IPV6, IPV6_V6ONLY, &yes) == -1)
return -1; goto err;
} }
/* /*
...@@ -509,7 +509,7 @@ static int open_inet_sk(struct file_desc *d) ...@@ -509,7 +509,7 @@ static int open_inet_sk(struct file_desc *d)
* The origin value of SO_REUSEADDR will be restored in post_open. * The origin value of SO_REUSEADDR will be restored in post_open.
*/ */
if (restore_opt(sk, SOL_SOCKET, SO_REUSEADDR, &yes)) if (restore_opt(sk, SOL_SOCKET, SO_REUSEADDR, &yes))
return -1; goto err;
if (tcp_connection(ie)) { if (tcp_connection(ie)) {
if (!opts.tcp_established_ok) { if (!opts.tcp_established_ok) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment