summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-01-29 16:18:12 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-01-29 16:18:12 +0100
commit2d99d6e7ea79fee780c1773a1725c97483646f34 (patch)
treed56b5bceb638d532ee54710cc7bb3175532edf6a /src/plugins
parent930285e4895ea0793e5152c8c40691a671c1e2fb (diff)
downloadweechat-2d99d6e7ea79fee780c1773a1725c97483646f34.zip
Fix crash when purging old xfer chats (bug #28764)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/xfer/xfer-chat.c20
1 files changed, 10 insertions, 10 deletions
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;