From 1df702127608761b12aa8a74d141747cf405069f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Janouch?= Date: Thu, 18 Jul 2013 00:15:41 +0200 Subject: [PATCH] Fix the dictionary loading error path --- src/stardict.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stardict.c b/src/stardict.c index a3b0866..c26bb52 100644 --- a/src/stardict.c +++ b/src/stardict.c @@ -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; }