From 7f0ae644cf0e885d81563153948c925ef5c24151 Mon Sep 17 00:00:00 2001 From: Alfons Hoogervorst Date: Fri, 20 Sep 2002 19:54:22 +0000 Subject: [PATCH] * 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 --- ChangeLog.claws | 11 +++++++++++ configure.in | 2 +- src/addr_compl.c | 2 ++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog.claws b/ChangeLog.claws index c1df2b402..ac6c64d76 100644 --- a/ChangeLog.claws +++ b/ChangeLog.claws @@ -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 diff --git a/configure.in b/configure.in index bc326b5db..cb2ed631b 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/src/addr_compl.c b/src/addr_compl.c index f6884235c..1ee3a7dff 100644 --- a/src/addr_compl.c +++ b/src/addr_compl.c @@ -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(); -- 2.25.1