Commit e47eccb1 authored by Andrey Vagin's avatar Andrey Vagin Committed by Pavel Emelyanov

page-server: don't forget to close a sever socket

CID 73348 (#1 of 1): Resource leak (RESOURCE_LEAK)
19. leaked_handle: Handle variable sk going out of scope leaks the handle.
Signed-off-by: 's avatarAndrey Vagin <avagin@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@parallels.com>
parent 2491da92
...@@ -307,8 +307,9 @@ int cr_page_server(bool daemon_mode, int cfd) ...@@ -307,8 +307,9 @@ int cr_page_server(bool daemon_mode, int cfd)
no_server: no_server:
if (daemon_mode) { if (daemon_mode) {
ret = cr_daemon(1, 0, &ask, cfd); ret = cr_daemon(1, 0, &ask, cfd);
close_safe(&sk);
if (ret == -1) { if (ret == -1) {
pr_perror("Can't run in the background"); pr_err("Can't run in the background\n");
goto out; goto out;
} }
if (ret > 0) { /* parent task, daemon started */ if (ret > 0) { /* parent task, daemon started */
......
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