[systemd-devel] [PATCH 3/3] [fd leak] Stop leaking fd in do_accept()
David Herrmann
dh.herrmann at gmail.com
Thu Sep 11 08:48:28 PDT 2014
Hi
On Wed, Sep 10, 2014 at 9:14 PM, <philippedeswert at gmail.com> wrote:
> From: Philippe De Swert <philippedeswert at gmail.com>
>
> Found with Coverity.
>
> Signed-off-by: Philippe De Swert <philippedeswert at gmail.com>
Looks good, applied!
Thanks
David
> ---
> src/activate/activate.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/activate/activate.c b/src/activate/activate.c
> index 8942773..0a1df37 100644
> --- a/src/activate/activate.c
> +++ b/src/activate/activate.c
> @@ -242,7 +242,7 @@ static int launch1(const char* child, char** argv, char **env, int fd) {
>
> static int do_accept(const char* name, char **argv, char **envp, int fd) {
> _cleanup_free_ char *local = NULL, *peer = NULL;
> - int fd2;
> + _cleanup_close_ int fd2 = -1;
>
> fd2 = accept(fd, NULL, NULL);
> if (fd2 < 0) {
> --
> 1.8.3.2
>
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list