--- a/libpurple/protocols/oscar/tlv.c Tue Dec 28 05:54:04 2010 +0000 +++ b/libpurple/protocols/oscar/tlv.c Tue Dec 28 05:57:57 2010 +0000 @@ -400,6 +400,7 @@ */ int aim_tlvlist_add_caps(GSList **list, const guint16 type, const guint64 caps, const char *mood) { + int len; ByteStream bs; guint32 bs_size; guint8 *data; @@ -417,7 +418,11 @@ if (data != NULL) byte_stream_putraw(&bs, data, 16); - return aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), bs.data); + len = aim_tlvlist_add_raw(list, type, byte_stream_curpos(&bs), bs.data); + + byte_stream_destroy(&bs); + + return len; } /**