# HG changeset patch # User Mark Doliner # Date 1156201106 0 # Node ID ddedf15a9420d05d21b47fa53bea2db19f2eadd2 # Parent 594fa42a785a4c30ed0a5d09ece3ba831410c28b [gaim-migrate @ 16966] If servconn is destroyed while it's in the process of being established, make sure the new fd is closed. Also, "0" is a valid file descriptor. It is pretty much ALWAYS set to either stdin, stdout or stderr, and then new file descriptors increment from there, but I don't think there's actually a standard that says that 0 must be one of those three. committer: Tailor Script diff -r 594fa42a785a -r ddedf15a9420 libgaim/protocols/msn/servconn.c --- a/libgaim/protocols/msn/servconn.c Mon Aug 21 22:56:08 2006 +0000 +++ b/libgaim/protocols/msn/servconn.c Mon Aug 21 22:58:26 2006 +0000 @@ -176,13 +176,15 @@ if (servconn->wasted) { + if (source >= 0) + close(source); msn_servconn_destroy(servconn); return; } servconn->fd = source; - if (source > 0) + if (source >= 0) { servconn->connected = TRUE;