# HG changeset patch # User Stu Tomlinson # Date 1205285931 0 # Node ID 34b8d1107b063de5d5565fef024413b7f2b1183b # Parent bb7b11ca28caa3ff6f2aae2a84fb92114d717675 Fix multiple memory leaks diff -r bb7b11ca28ca -r 34b8d1107b06 ChangeLog --- a/ChangeLog Wed Mar 12 01:37:15 2008 +0000 +++ b/ChangeLog Wed Mar 12 01:38:51 2008 +0000 @@ -23,6 +23,7 @@ * Fix some cases of the conversation input entry area being 1 pixel high * Fix for displaying channel & buddy names in conversation window when they have '&' in them + * Some memory leak fixes, especially in the Text Replacement plugin Finch: * Fix compiling with Glib older than 2.6 diff -r bb7b11ca28ca -r 34b8d1107b06 pidgin/plugins/spellchk.c --- a/pidgin/plugins/spellchk.c Wed Mar 12 01:37:15 2008 +0000 +++ b/pidgin/plugins/spellchk.c Wed Mar 12 01:38:51 2008 +0000 @@ -64,7 +64,7 @@ GtkTextMark *mark_insert_start; GtkTextMark *mark_insert_end; - const gchar *word; + gchar *word; gboolean inserting; gboolean ignore_correction; gboolean ignore_correction_on_send; @@ -265,6 +265,7 @@ g_value_unset(&val1); g_value_unset(&val2); + g_free(lowerword); g_free(foldedword); return outword; } @@ -274,6 +275,7 @@ } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(model), &iter)); } + g_free(lowerword); g_free(foldedword); return NULL; @@ -292,6 +294,7 @@ G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, spell); + g_free(spell->word); g_free(spell); } @@ -440,6 +443,7 @@ /* Move backwards to the beginning of the word. */ spellchk_backward_word_start(&start); + g_free(spell->word); spell->word = gtk_text_iter_get_text(&start, &end); /* Hack because otherwise typing things like U.S. gets difficult @@ -484,6 +488,7 @@ } g_free(tmp); + g_free(spell->word); spell->word = NULL; return replaced; @@ -504,6 +509,7 @@ spell->inserting = TRUE; + g_free(spell->word); spell->word = NULL; gtk_text_buffer_move_mark(buffer, spell->mark_insert_start, iter); @@ -561,6 +567,7 @@ place = gtk_text_iter_get_offset(&pos); if ((place + 1) != spell->pos) { + g_free(spell->word); spell->word = NULL; return; } @@ -574,6 +581,7 @@ spell->ignore_correction_on_send = TRUE; spell->inserting = FALSE; + g_free(spell->word); spell->word = NULL; }