efl thread - fic pipe close to not close invalid pipe fds

if we only have stdout and no stdin we'd accidentally close junk int's
on the stack. fix this fix CID 1396963
This commit is contained in:
Carsten Haitzler 2019-08-10 23:09:06 +01:00
parent 4fb161ee1a
commit d0d883b1c9
1 changed files with 5 additions and 2 deletions

View File

@ -604,8 +604,11 @@ _efl_thread_efl_task_run(Eo *obj, Efl_Thread_Data *pd)
if (pipe(pipe_from_thread) != 0)
{
ERR("Can't create from_thread pipe");
close(pipe_to_thread[0]);
close(pipe_to_thread[1]);
if (td->flags & EFL_TASK_FLAGS_USE_STDIN)
{
close(pipe_to_thread[0]);
close(pipe_to_thread[1]);
}
free(thdat);
return NULL;
}