extcap: Close stdout_fd and stderr_fd when done

The documentation for g_spawn_async_with_pipes() states that stdout_fd
and stderr_fd must be closed when they are no longer in use.

Ping-Bug: 15205
Change-Id: I943eaa68058b0828686469672ea3611e67390b2f
Reviewed-on: https://code.wireshark.org/review/30221
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
This commit is contained in:
Stig Bjørlykke 2018-10-15 20:41:39 +02:00
parent ca50195f11
commit c826e2a77e
1 changed files with 10 additions and 0 deletions

View File

@ -1187,6 +1187,16 @@ void extcap_if_cleanup(capture_options *capture_opts, gchar **errormsg)
interface_opts->extcap_child_watch = 0;
}
if (pipedata->stdout_fd > 0)
{
ws_close(pipedata->stdout_fd);
}
if (pipedata->stderr_fd > 0)
{
ws_close(pipedata->stderr_fd);
}
if (interface_opts->extcap_pid != WS_INVALID_PID)
{
#ifdef _WIN32