# HG changeset patch # User Elliott Sales de Andrade # Date 1272056037 0 # Node ID e47a4a7940eac08861aaf4ecfae15d7f136dcd5b # Parent 09e15f831d7ef2e76641d1d183bc33da5724fa2e Fix some leaks, and simplify these branches. diff -r 09e15f831d7e -r e47a4a7940ea libpurple/protocols/msn/slp.c --- a/libpurple/protocols/msn/slp.c Fri Apr 23 20:45:05 2010 +0000 +++ b/libpurple/protocols/msn/slp.c Fri Apr 23 20:53:57 2010 +0000 @@ -679,6 +679,8 @@ * TCP connection is not supported. */ } + + g_free(bridges); } else if (!strcmp(type, "application/x-msnmsgr-transrespbody")) { @@ -827,6 +829,7 @@ content = get_token(body, "\r\n\r\n", NULL); + slpcall = NULL; if (branch && call_id) { slpcall = msn_slplink_find_slp_call(slplink, call_id); @@ -838,21 +841,12 @@ else if (content_type && content) { slpcall = msn_slpcall_new(slplink); - slpcall->id = call_id; + slpcall->id = g_strdup(call_id); got_invite(slpcall, branch, content_type, content); } - else - { - g_free(call_id); - slpcall = NULL; - } - } - else - { - g_free(call_id); - slpcall = NULL; } + g_free(call_id); g_free(branch); g_free(content_type); g_free(content);