From 2d99d6e7ea79fee780c1773a1725c97483646f34 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 29 Jan 2010 16:18:12 +0100 Subject: Fix crash when purging old xfer chats (bug #28764) --- src/plugins/xfer/xfer-chat.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'src/plugins') 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; -- cgit v1.2.3