fix use after free

This commit is contained in:
derselbst 2017-10-21 12:48:52 +02:00
parent b266369561
commit 9e3b01927e

View file

@ -753,7 +753,15 @@ new_fluid_timer (int msec, fluid_timer_callback_t callback, void* data,
return NULL;
}
}
else fluid_timer_run (timer); /* Run directly, instead of as a separate thread */
else
{
fluid_timer_run (timer); /* Run directly, instead of as a separate thread */
if(timer->auto_destroy)
{
/* do NOT return freed memory */
return NULL;
}
}
return timer;
}