util_runcmd: Free the fde in event handler.
authorGary Lockyer <gary@catalyst.net.nz>
Fri, 8 Sep 2017 02:03:25 +0000 (14:03 +1200)
committerRalph Boehme <slow@samba.org>
Sat, 16 Sep 2017 21:50:27 +0000 (23:50 +0200)
Free the fde in the event handler to prevent the event triggering again
While not strictly necessary in this case, this code serves as an
example of the usage of tfork.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=13037

Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sat Sep 16 23:50:27 CEST 2017 on sn-devel-144

lib/util/util_runcmd.c

index ac74371e76de808e3d10ace3a978152bba71cec7..6077fddde56274d707403da507f3d73f062eb826 100644 (file)
@@ -275,6 +275,7 @@ static void samba_runcmd_io_handler(struct tevent_context *ev,
                        tevent_req_error(req, errno);
                        return;
                }
+               TALLOC_FREE(fde);
 
                if (WIFEXITED(status)) {
                        status = WEXITSTATUS(status);