• Tycho Andersen's avatar
    unix: handle unlink failure correctly · 40a37ae7
    Tycho Andersen authored
    Instead of returning, we should revert the cwd as in all the other error
    paths.
    
    *** CID 164720:  Resource leaks  (RESOURCE_LEAK)
    /criu/sk-unix.c: 1030 in bind_unix_sk()
    1024                                    goto done;
    1025                            }
    1026                    }
    1027
    1028                    if (ui->ue->deleted && unlink((char
    *)ui->ue->name.data) < 0) {
    1029                            pr_perror("failed to unlink %s\n",
    ui->ue->name.data);
    >>> >>>     CID 164720:  Resource leaks  (RESOURCE_LEAK)
    >>> >>>     Handle variable "cwd_fd" going out of scope leaks the handle.
    1030                            return -1;
    1031                    }
    1032            }
    1033
    1034            if (ui->ue->state != TCP_LISTEN)
    1035                    futex_set_and_wake(&ui->prepared, 1);
    Signed-off-by: 's avatarTycho Andersen <tycho.andersen@canonical.com>
    CC: Andrew Vagin <avagin@virtuozzo.com>
    Acked-by: 's avatarAndrew Vagin <avagin@virtuozzo.com>
    Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
    40a37ae7
Name
Last commit
Last update
Documentation Loading commit data...
contrib Loading commit data...
coredump Loading commit data...
crit Loading commit data...
criu Loading commit data...
images Loading commit data...
lib Loading commit data...
scripts Loading commit data...
test Loading commit data...
.gitignore Loading commit data...
.mailmap Loading commit data...
.travis.yml Loading commit data...
COPYING Loading commit data...
CREDITS Loading commit data...
INSTALL.md Loading commit data...
Makefile Loading commit data...
Makefile.install Loading commit data...
Makefile.versions Loading commit data...
README.md Loading commit data...