# HG changeset patch # User Daniel Atallah # Date 1286422373 0 # Node ID 485eaf544bb0670ad3a491d0ee5b02d6ab4e867e # Parent de168bbf1e4310db28ab10653d76c854932bf12f Beginning a file transfer multiple times leaks file handles. Add some debugging and guarding to detect and avoid that. This is only part of the full fix (mostly to help bring attention to the problem) The real problem is that in the MSN prpl (and possibly others), file transfers are started multiple times. This happens for every file transfer over MSN that I've tested. Refs #12660 diff -r de168bbf1e43 -r 485eaf544bb0 libpurple/ft.c --- a/libpurple/ft.c Thu Oct 07 02:02:15 2010 +0000 +++ b/libpurple/ft.c Thu Oct 07 03:32:53 2010 +0000 @@ -1291,6 +1291,11 @@ PurpleXferType type = purple_xfer_get_type(xfer); PurpleXferUiOps *ui_ops = purple_xfer_get_ui_ops(xfer); + if (xfer->start_time != 0) { + purple_debug_error("xfer", "Transfer is being started multiple times\n"); + g_return_if_reached(); + } + if (ui_ops == NULL || (ui_ops->ui_read == NULL && ui_ops->ui_write == NULL)) { xfer->dest_fp = g_fopen(purple_xfer_get_local_filename(xfer), type == PURPLE_XFER_RECEIVE ? "wb" : "rb");