Fix some use-after-free holes.

This commit is contained in:
Alcaro 2016-03-18 17:18:34 +01:00
parent 160118ff6c
commit ba90c4afaf

View File

@ -409,7 +409,8 @@ static void *gfx_ctx_x_init(void *data)
return x;
error:
gfx_ctx_x_destroy_resources(x);
if (x)
gfx_ctx_x_destroy_resources(x);
if (x)
free(x);
@ -729,6 +730,7 @@ static bool gfx_ctx_x_set_video_mode(void *data,
XSetErrorHandler(old_handler);
XFree(vi);
vi = NULL;
if (!x11_input_ctx_new(true_full))
goto error;