copy_and_spawn_sgid: Avoid double calls to close()

If close() on infd and outfd succeeded, reset the fd numbers so that
we don't attempt to close them again.

Reviewed-by: Arjun Shankar <arjun@redhat.com>
This commit is contained in:
Siddhesh Poyarekar 2021-08-03 21:10:53 +05:30
parent 1e0e6d656d
commit 45caed9d67

View file

@ -170,6 +170,7 @@ copy_and_spawn_sgid (char *child_id, gid_t gid)
support_subprogram because we only want the program exit status, not the
contents. */
ret = 0;
infd = outfd = -1;
char * const args[] = {execname, child_id, NULL};