mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-22 17:49:13 +00:00
files: don't leak a socket in error cases
CID 173074 (#1 of 1): Resource leak (RESOURCE_LEAK) 9. leaked_handle: Handle variable sock going out of scope leaks the handle. Signed-off-by: Andrei Vagin <avagin@virtuozzo.com> Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com>
This commit is contained in:
parent
65d79e9482
commit
3bdcd52f4e
1 changed files with 1 additions and 0 deletions
|
|
@ -1683,6 +1683,7 @@ int open_transport_socket(void)
|
|||
transport_name_gen(&saddr, &slen, pid, -1);
|
||||
if (bind(sock, (struct sockaddr *)&saddr, slen) < 0) {
|
||||
pr_perror("Can't bind transport socket %s", saddr.sun_path + 1);
|
||||
close(sock);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue