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

View File

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