Prevent a use-after-free. The timeout_cb may free the MsnTransaction,

Sun, 21 Nov 2010 06:58:45 +0000

author
Elliott Sales de Andrade <qulogic@pidgin.im>
date
Sun, 21 Nov 2010 06:58:45 +0000
changeset 31134
cd372fe45f02
parent 31133
9383e6398f7d
child 31135
f256308961f6

Prevent a use-after-free. The timeout_cb may free the MsnTransaction,
so we can't use it after that.

libpurple/protocols/msn/transaction.c file | annotate | diff | comparison | revisions
--- a/libpurple/protocols/msn/transaction.c	Sun Nov 21 00:53:26 2010 +0000
+++ b/libpurple/protocols/msn/transaction.c	Sun Nov 21 06:58:45 2010 +0000
@@ -220,10 +220,11 @@
 	purple_debug_info("msn", "timed out: %s %d %s\n", trans->command, trans->trId, trans->params);
 #endif
 
+	trans->timer = 0;
+
 	if (trans->timeout_cb != NULL)
 		trans->timeout_cb(trans->cmdproc, trans);
 
-	trans->timer = 0;
 	return FALSE;
 }
 

mercurial