Commit 9dd80678 authored by Pavel Borzenkov's avatar Pavel Borzenkov Committed by Sebastian Ramacher
Browse files

Make sure we don't pass garbage to g_mutex_free()


Signed-off-by: default avatarPavel Borzenkov <pavel.borzenkov@gmail.com>
Signed-off-by: default avatarSebastian Ramacher <s.ramacher@gmx.at>
parent 86088236
......@@ -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;
}
......
Supports Markdown
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