From 8263c86671160d6994f319ee7c39d044e709e9da Mon Sep 17 00:00:00 2001 From: Stefan Becker Date: Tue, 26 Aug 2014 19:53:34 +0300 Subject: [PATCH] transport: fix potential memory leak when signing message Another leak reported in this forum thread https://sourceforge.net/p/sipe/discussion/688534/thread/4aca1c0a/ NOTE: I could not reproduce it so this fix is just a guess. (cherry picked from commit 71e1c0021b25291031a5db2fb89a656f483728fd) --- src/core/sip-transport.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/core/sip-transport.c b/src/core/sip-transport.c index e4dcde5f..573c4564 100644 --- a/src/core/sip-transport.c +++ b/src/core/sip-transport.c @@ -168,8 +168,11 @@ static void sipe_make_signature(struct sipe_core_private *sipe_private, signature_input_str = sipmsg_breakdown_get_string(transport->registrar.version, &msgbd); if (signature_input_str != NULL) { char *signature_hex = sip_sec_make_signature(transport->registrar.gssapi_context, signature_input_str); + g_free(msg->signature); msg->signature = signature_hex; + g_free(msg->rand); msg->rand = g_strdup(msgbd.rand); + g_free(msg->num); msg->num = g_strdup(msgbd.num); g_free(signature_input_str); } -- 2.11.4.GIT