aboutsummaryrefslogtreecommitdiffstats
path: root/extcap.c
diff options
context:
space:
mode:
Diffstat (limited to 'extcap.c')
-rw-r--r--extcap.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/extcap.c b/extcap.c
index 7b468be5f8..0132f01172 100644
--- a/extcap.c
+++ b/extcap.c
@@ -1187,23 +1187,25 @@ 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) {
+ if (pipedata->stdout_fd > 0)
+ {
+ ws_close(pipedata->stdout_fd);
+ }
- if (pipedata->stderr_fd > 0)
- {
- ws_close(pipedata->stderr_fd);
- }
+ if (pipedata->stderr_fd > 0)
+ {
+ ws_close(pipedata->stderr_fd);
+ }
- if (interface_opts->extcap_pid != WS_INVALID_PID)
- {
- ws_pipe_close((ws_pipe_t *) interface_opts->extcap_pipedata);
- interface_opts->extcap_pid = WS_INVALID_PID;
+ if (interface_opts->extcap_pid != WS_INVALID_PID)
+ {
+ ws_pipe_close(pipedata);
+ interface_opts->extcap_pid = WS_INVALID_PID;
- g_free(interface_opts->extcap_pipedata);
- interface_opts->extcap_pipedata = NULL;
+ g_free(pipedata);
+ interface_opts->extcap_pipedata = NULL;
+ }
}
}
}