More precise cleanup in GTK+ uiInitErrorFree().

This commit is contained in:
Pietro Gagliardi 2015-04-06 12:25:16 -04:00
parent fc19f776c4
commit 1a5d6a0f49
1 changed files with 2 additions and 1 deletions

View File

@ -12,7 +12,7 @@ uiInitError *uiInit(uiInitOptions *o)
e = g_new0(uiInitError, 1); e = g_new0(uiInitError, 1);
if (gtk_init_with_args(NULL, NULL, NULL, NULL, NULL, &(e->err)) == FALSE) if (gtk_init_with_args(NULL, NULL, NULL, NULL, NULL, &(e->err)) == FALSE)
return e; return e;
uiInitErrorFree(e); g_free(e);
return NULL; return NULL;
} }
@ -23,5 +23,6 @@ const char *uiInitErrorMessage(uiInitError *e)
void uiInitErrorFree(uiInitError *e) void uiInitErrorFree(uiInitError *e)
{ {
g_error_free(e->err);
g_free(e); g_free(e);
} }