lib/util/run_cmd: ensure fd_stdin gets set to -1 in the destructor
authorRalph Boehme <slow@samba.org>
Fri, 29 Sep 2017 11:06:08 +0000 (13:06 +0200)
committerRalph Boehme <slow@samba.org>
Sat, 30 Sep 2017 06:01:24 +0000 (08:01 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13062

Pair-programmed-with: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
lib/util/util_runcmd.c

index ef3402ad33fccd305393a16b5cb1b4355ccb4ede..9c6cb307a8eb1a51c6836854d0ed1f0a677548cb 100644 (file)
@@ -41,6 +41,7 @@ static int samba_runcmd_state_destructor(struct samba_runcmd_state *state)
 
        if (state->fd_stdin != -1) {
                close(state->fd_stdin);
+               state->fd_stdin = -1;
        }
        return 0;
 }