Mercurial > pidgin
diff libpurple/protocols/msnp9/cmdproc.c @ 23011:ba47ec8a2477
When adding outgoing MSN commands to the MsnHistory, free
MsnTransaction->payload to save memory.
MSN_HIST_ELEMS * MSN_BUF_LEN (used in msn_message_gen_payload)
= 48 * 8192 bytes = 384 KB per online MSN account = a lot of wasted memory
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Tue, 20 May 2008 20:59:21 +0000 |
parents | a07cfce78345 |
children |
line wrap: on
line diff
--- a/libpurple/protocols/msnp9/cmdproc.c Tue May 20 19:49:26 2008 +0000 +++ b/libpurple/protocols/msnp9/cmdproc.c Tue May 20 20:59:21 2008 +0000 @@ -132,6 +132,14 @@ data = g_realloc(data, len + trans->payload_len); memcpy(data + len, trans->payload, trans->payload_len); len += trans->payload_len; + + /* + * We're done with trans->payload. Free it so that the memory + * doesn't sit around in cmdproc->history. + */ + g_free(trans->payload); + trans->payload = NULL; + trans->payload_len = 0; } msn_servconn_write(servconn, data, len);