mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-12-29 08:16:00 +01:00
Make sure we don't pass garbage to g_mutex_free()
Signed-off-by: Pavel Borzenkov <pavel.borzenkov@gmail.com> Signed-off-by: Sebastian Ramacher <s.ramacher@gmx.at>
This commit is contained in:
parent
8608823613
commit
9dd8067873
1 changed files with 2 additions and 11 deletions
13
render.c
13
render.c
|
@ -47,16 +47,9 @@ render_job(void* data)
|
|||
render_thread_t*
|
||||
render_init(zathura_t* zathura)
|
||||
{
|
||||
render_thread_t* render_thread = malloc(sizeof(render_thread_t));
|
||||
|
||||
if (!render_thread) {
|
||||
goto error_ret;
|
||||
}
|
||||
render_thread_t* render_thread = g_malloc0(sizeof(render_thread_t));
|
||||
|
||||
/* init */
|
||||
render_thread->list = NULL;
|
||||
render_thread->thread = NULL;
|
||||
render_thread->cond = NULL;
|
||||
render_thread->zathura = zathura;
|
||||
|
||||
/* setup */
|
||||
|
@ -100,9 +93,7 @@ error_free:
|
|||
g_mutex_free(render_thread->lock);
|
||||
}
|
||||
|
||||
free(render_thread);
|
||||
|
||||
error_ret:
|
||||
g_free(render_thread);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue