Commit 02a64e24 authored by Jean-Paul Saman's avatar Jean-Paul Saman

examples/dvbinfo: do not use after free.

The param struct was used after it was freed.
parent 8139d078
......@@ -196,6 +196,7 @@ static void params_free(params_t *param)
free(param->input);
free(param->output);
free(param->summary.file);
param = NULL;
}
/* */
......@@ -646,7 +647,6 @@ int main(int argc, char **pp_argv)
if (param->input == NULL)
{
libdvbpsi_log(param, DVBINFO_LOG_ERROR, "No source given\n");
params_free(param);
#ifdef HAVE_SYS_SOCKET_H
if (param->b_monitor)
closelog();
......@@ -692,8 +692,6 @@ int main(int argc, char **pp_argv)
dvbinfo_close(param);
/* cleanup */
params_free(param);
fifo_wake((&capture)->fifo);
fifo_wake((&capture)->empty);
......@@ -707,6 +705,8 @@ int main(int argc, char **pp_argv)
if (param->b_monitor)
closelog();
#endif
params_free(param);
if (err < 0)
exit(EXIT_FAILURE);
else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment