summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/plugins/xfer/xfer-chat.c20
2 files changed, 11 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 756050bfa..d73681f67 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,7 @@ Version 0.3.2 (under dev!)
* irc: add options irc.look.smart_filter_join and irc.look.smart_filter_quit
* irc: fix compilation with old GnuTLS versions (bug #28723)
* logger: allow date format in logger options path and mask (task #9430)
+* xfer: fix crash when purging old xfer chats (bug #28764)
Version 0.3.1 (2010-01-23)
--------------------------
diff --git a/src/plugins/xfer/xfer-chat.c b/src/plugins/xfer/xfer-chat.c
index 3bc3191a7..e12af3da5 100644
--- a/src/plugins/xfer/xfer-chat.c
+++ b/src/plugins/xfer/xfer-chat.c
@@ -278,18 +278,18 @@ xfer_chat_buffer_close_cb (void *data, struct t_gui_buffer *buffer)
/* make C compiler happy */
(void) data;
(void) buffer;
-
- ptr_xfer = xfer_search_by_buffer (buffer);
-
- if (ptr_xfer)
- {
- if (!XFER_HAS_ENDED(ptr_xfer->status))
+
+ for (ptr_xfer = xfer_list; ptr_xfer; ptr_xfer = ptr_xfer->next_xfer)
+ {
+ if (ptr_xfer->buffer == buffer)
{
- xfer_close (ptr_xfer, XFER_STATUS_ABORTED);
- xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);
+ if (!XFER_HAS_ENDED(ptr_xfer->status))
+ {
+ xfer_close (ptr_xfer, XFER_STATUS_ABORTED);
+ xfer_buffer_refresh (WEECHAT_HOTLIST_MESSAGE);
+ }
+ ptr_xfer->buffer = NULL;
}
-
- ptr_xfer->buffer = NULL;
}
return WEECHAT_RC_OK;