pidgin/plugins/spellchk.c

branch
soc.2013.gobjectification.plugins
changeset 37144
8b63b9948107
parent 37109
94d1a2589d5a
parent 36002
31a8779e91d4
child 37145
8826f95514fd
--- a/pidgin/plugins/spellchk.c	Sun May 04 06:28:56 2014 +0530
+++ b/pidgin/plugins/spellchk.c	Sat May 10 03:56:36 2014 +0530
@@ -1786,12 +1786,11 @@
 	gboolean case_sensitive = FALSE;
 
 	buf = g_build_filename(purple_user_dir(), "dict", NULL);
-	g_file_get_contents(buf, &ibuf, &size, NULL);
-	g_free(buf);
-	if (!ibuf) {
+	if (g_file_get_contents(buf, &ibuf, &size, NULL) && ibuf) {
 		ibuf = g_strdup(defaultconf);
 		size = strlen(defaultconf);
 	}
+	g_free(buf);
 
 	model = gtk_list_store_new((gint)N_COLUMNS, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN);
 	hashes = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, NULL);

mercurial