I know Sean is doing server.c death meanuvers; this might be worth fixing in the process:

Right now, most of the server.c functions look like:
void serv_rem_deny(GaimConnection *g, const char *name)
{
GaimPluginProtocolInfo *prpl_info = NULL;

if (g != NULL && g->prpl != NULL)
prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(g->prpl);

if (prpl_info && g_list_find(gaim_connections_get_all(), g) && prpl_info->rem_deny)
prpl_info->rem_deny(g, name);
}

bolding mine.

If the GaimConnection isn't valid, there's a good chance that g->prpl is going to crash before that check even happens.  The check is just slightly upping the chances that we don't crash -- we got away with it once, accessing freed memory, but this way we don't send it to the prpl to roll the dice even more.

Either the GaimConnection is always valid, in which case that check is needless, or it isn't always valid, in which case it should be a
g_return_if_fail(GAIM_CONNECTION_IS_VALID(gc));
or the like.

I got this crash earlier while rapidly signing gadu-gadu offline and online:
#0  serv_set_permit_deny (g=0xd4513a0) at /Users/evands/libgaim/Libgaim/src/server.c:315
        prpl_info = (struct _GaimPluginProtocolInfo *) 0x7999d74
#1  0x0773c938 in gaim_connection_set_state (gc=0xd4513a0, state=126271292) at /Users/evands/libgaim/Libgaim/src/connection.c:301
        account = (struct _GaimAccount *) 0xd482700
        presence = (struct _GaimPresence *) 0xd482800
        ops = (GaimConnectionUiOps *) 0x375e034
#2  0x077521fc in ggp_async_login_handler (_gc=0xd4513a0, fd=0x786bf3c, cond=4278124287) at /Users/evands/libgaim/Libgaim/src/protocols/gg/gg.c:1479
        account = (struct _GaimAccount *) 0xd482700
        status = (struct _GaimStatus *) 0x786bf3c
        gc = (struct _GaimConnection *) 0xd4513a0
        info = (GGPInfo *) 0xd482700
        ev = (struct gg_event *) 0xf1a8470
#3   <socket callback>

which is a way of saying (1) that gadu-gadu may be freeing memory somewhere before unregistering its fd listener and (2) there's at least one existing codepath that can crash at present but wouldn't, I think, with the check higher up in the function.

-Evan