Fix the dictionary loading error path

This commit is contained in:
Přemysl Eric Janouch 2013-07-18 00:15:41 +02:00
parent 852667350b
commit 1df7021276
1 changed files with 4 additions and 2 deletions

View File

@ -378,7 +378,9 @@ stardict_dict_finalize (GObject *self)
{
StardictDictPrivate *priv = STARDICT_DICT (self)->priv;
stardict_info_free (priv->info);
if (priv->info)
stardict_info_free (priv->info);
g_array_free (priv->index, TRUE);
g_array_free (priv->synonyms, TRUE);
@ -705,8 +707,8 @@ stardict_dict_new_from_info (StardictInfo *sdi, GError **error)
return sd;
error:
g_array_free (priv->index, TRUE);
g_free (base);
priv->info = NULL;
g_object_unref (sd);
return NULL;
}