Commit d1f657ef authored by Andrew Vagin's avatar Andrew Vagin Committed by Andrei Vagin

uffd: don't close the same descriptor twice

>>> >>>     CID 161322:  API usage errors  (USE_AFTER_FREE)
>>> >>>     Calling "close(int)" closes handle "client" which has already been closed.
Signed-off-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent c443faca
...@@ -288,7 +288,7 @@ static struct lazy_pages_info *ud_open(int listen, struct sockaddr_un *saddr) ...@@ -288,7 +288,7 @@ static struct lazy_pages_info *ud_open(int listen, struct sockaddr_un *saddr)
goto out; goto out;
} }
pr_debug("lpi->uffd %d\n", lpi->uffd); pr_debug("lpi->uffd %d\n", lpi->uffd);
close(client); close_safe(&client);
pr_debug("uffd is 0x%d\n", lpi->uffd); pr_debug("uffd is 0x%d\n", lpi->uffd);
uffd_flags = fcntl(lpi->uffd, F_GETFD, NULL); uffd_flags = fcntl(lpi->uffd, F_GETFD, NULL);
...@@ -307,7 +307,7 @@ static struct lazy_pages_info *ud_open(int listen, struct sockaddr_un *saddr) ...@@ -307,7 +307,7 @@ static struct lazy_pages_info *ud_open(int listen, struct sockaddr_un *saddr)
out: out:
lpi_fini(lpi); lpi_fini(lpi);
close(client); close_safe(&client);
return NULL; return NULL;
} }
......
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