Mercurial > hg
changeset 1071:866be086cc9b
Fix a memory leak in JEP22 handling
author | Mikael Berthe <mikael@lilotux.net> |
---|---|
date | Sun, 03 Dec 2006 12:00:17 +0100 |
parents | 9eaacc0ad3a2 |
children | 2a3cfb98bd5e |
files | mcabber/src/jabglue.c |
diffstat | 1 files changed, 8 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/mcabber/src/jabglue.c Sun Dec 03 11:59:42 2006 +0100 +++ b/mcabber/src/jabglue.c Sun Dec 03 12:00:17 2006 +0100 @@ -495,6 +495,7 @@ // new_msgid() // Generate a new id string. The caller should free it. +// The caller must free the string when no longer needed. static char *new_msgid(void) { static guint msg_idn; @@ -523,6 +524,9 @@ guint use_jep85 = 0; struct jep0085 *jep85 = NULL; #endif +#if defined JEP0022 + gchar *nmsgid = NULL; +#endif gchar *enc = NULL; if (encrypted) @@ -631,7 +635,7 @@ // An id is mandatory when using JEP-0022. if (!msgid && (text || subject)) { - msgid = new_msgid(); + msgid = nmsgid = new_msgid(); // Let's update last_msgid_sent // (We do not update it when the msgid is provided by the caller, // because this is probably a special message...) @@ -648,6 +652,9 @@ jab_send(jc, x); xmlnode_free(x); +#if defined JEP0022 + g_free(nmsgid); +#endif jb_reset_keepalive(); }