* src/addr_compl.c
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 20 Sep 2002 19:54:22 +0000 (19:54 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Fri, 20 Sep 2002 19:54:22 +0000 (19:54 +0000)
replace_address_in_edit(): strict check for NULL address to
fix "[ 607348 ] Segfault in address completion". My guess is
that this happens with an empty address book, but it's good
to have this check here anyway

completion_window_button_press(): free string returned
from the internal cache

ChangeLog.claws
configure.in
src/addr_compl.c

index c1df2b4..ac6c64d 100644 (file)
@@ -1,3 +1,14 @@
+2002-09-20 [alfons]    0.8.2claws62
+
+       * src/addr_compl.c
+               replace_address_in_edit(): strict check for NULL address to
+               fix "[ 607348 ] Segfault in address completion". My guess is
+               that this happens with an empty address book, but it's good
+               to have this check here anyway
+               
+               completion_window_button_press(): free string returned 
+               from the internal cache
+
 2002-09-20 [christoph] 0.8.2claws61
 
        * src/procmime.h
index bc326b5..cb2ed63 100644 (file)
@@ -10,7 +10,7 @@ MINOR_VERSION=8
 MICRO_VERSION=2
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws61
+EXTRA_VERSION=claws62
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index f688423..1ee3a7d 100644 (file)
@@ -288,6 +288,7 @@ gchar *get_address_from_edit(GtkEntry *entry, gint *start_pos)
 void replace_address_in_edit(GtkEntry *entry, const gchar *newtext,
                             gint start_pos)
 {
+       if (!newtext) return;
        gtk_editable_delete_text(GTK_EDITABLE(entry), start_pos, -1);
        gtk_editable_insert_text(GTK_EDITABLE(entry), newtext, strlen(newtext),
                                 &start_pos);
@@ -869,6 +870,7 @@ static gboolean completion_window_button_press(GtkWidget *widget,
                prefix = get_complete_address(0);
                g_free(get_address_from_edit(GTK_ENTRY(entry), &cursor_pos));
                replace_address_in_edit(GTK_ENTRY(entry), prefix, cursor_pos);
+               g_free(prefix);
        }
 
        clear_completion_cache();