summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2013-07-18 00:15:41 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2013-07-18 00:16:57 +0200
commit1df702127608761b12aa8a74d141747cf405069f (patch)
tree533875e9cf20d3a624d616c49394436ca6c7e110 /src
parent852667350b46e025a2d6f04b25da72ef6cb057ce (diff)
downloadtdv-1df702127608761b12aa8a74d141747cf405069f.tar.gz
tdv-1df702127608761b12aa8a74d141747cf405069f.tar.xz
tdv-1df702127608761b12aa8a74d141747cf405069f.zip
Fix the dictionary loading error path
Diffstat (limited to 'src')
-rw-r--r--src/stardict.c6
1 files 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;
}