Mercurial > pidgin.yaz
diff libpurple/protocols/msn/cmdproc.c @ 32249:6ce4f2272abc
Fix a crash when the account is disconnected and we have requested a SB. (Hanzz, ported by shlomif)(Fixes #12431)
author | masca@cpw.pidgin.im |
---|---|
date | Sun, 14 Aug 2011 19:04:59 +0000 |
parents | 05e05d96ba75 |
children |
line wrap: on
line diff
--- a/libpurple/protocols/msn/cmdproc.c Sat Aug 13 21:57:35 2011 +0000 +++ b/libpurple/protocols/msn/cmdproc.c Sun Aug 14 19:04:59 2011 +0000 @@ -109,21 +109,22 @@ g_free(show); } -void +gboolean msn_cmdproc_send_trans(MsnCmdProc *cmdproc, MsnTransaction *trans) { MsnServConn *servconn; char *data; size_t len; + gboolean ret; - g_return_if_fail(cmdproc != NULL); - g_return_if_fail(trans != NULL); + g_return_val_if_fail(cmdproc != NULL, TRUE); + g_return_val_if_fail(trans != NULL, TRUE); servconn = cmdproc->servconn; if (!servconn->connected) { msn_transaction_destroy(trans); - return; + return FALSE; } if (trans->saveable) @@ -154,11 +155,12 @@ trans->payload_len = 0; } - msn_servconn_write(servconn, data, len); + ret = msn_servconn_write(servconn, data, len) != -1; if (!trans->saveable) msn_transaction_destroy(trans); g_free(data); + return ret; } void