diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-01-29 16:18:12 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-01-29 16:18:12 +0100 |
commit | 2d99d6e7ea79fee780c1773a1725c97483646f34 (patch) | |
tree | d56b5bceb638d532ee54710cc7bb3175532edf6a | |
parent | 930285e4895ea0793e5152c8c40691a671c1e2fb (diff) | |
download | weechat-2d99d6e7ea79fee780c1773a1725c97483646f34.zip |
Fix crash when purging old xfer chats (bug #28764)
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | src/plugins/xfer/xfer-chat.c | 20 |
2 files changed, 11 insertions, 10 deletions
@@ -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; |