diff options
author | Anders Broman <anders.broman@ericsson.com> | 2005-02-07 08:54:24 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2005-02-07 08:54:24 +0000 |
commit | bc04baef424c0dd1cb25ae1a6d17d1bae1f629c8 (patch) | |
tree | fbd75bd036f33261d070221134851a8bd6605b1f /plugins/mate | |
parent | 82908eac116934e4d7b10e900d28f4993582f9fe (diff) |
From LEGO:
- fixes a leak in analize_pdu()
- fixes a typo in analize_pdu()
- fixes a crash in scs_unsubscribe()
- save a malloc and a free in get_pdu_fields()
svn path=/trunk/; revision=13335
Diffstat (limited to 'plugins/mate')
-rw-r--r-- | plugins/mate/mate_runtime.c | 20 | ||||
-rw-r--r-- | plugins/mate/mate_util.c | 2 |
2 files changed, 13 insertions, 9 deletions
diff --git a/plugins/mate/mate_runtime.c b/plugins/mate/mate_runtime.c index 8b3dedc11d..e13e322323 100644 --- a/plugins/mate/mate_runtime.c +++ b/plugins/mate/mate_runtime.c @@ -484,7 +484,7 @@ static void analize_pdu(mate_pdu* pdu) { /* does the pdu matches the prematch candidate key for the gop type? */ - gopkey_match = new_avpl_exact_match("",pdu->avpl,candidate_gop_key_match, TRUE); + gopkey_match = new_avpl_exact_match("gop_key_match",pdu->avpl,candidate_gop_key_match, TRUE); if (gopkey_match) { gop_key = avpl_to_str(gopkey_match); @@ -577,12 +577,14 @@ static void analize_pdu(mate_pdu* pdu) { } if ( ! gop ) { - delete_avpl(gogkey_match,FALSE); + g_free(gop_key); + delete_avpl(gopkey_match,TRUE); return; } } else { - delete_avpl(gogkey_match,FALSE); + g_free(gop_key); + delete_avpl(gopkey_match,TRUE); return; } @@ -592,8 +594,8 @@ static void analize_pdu(mate_pdu* pdu) { pdu->gop = NULL; pdu->next = NULL; - delete_avpl(gogkey_match,FALSE); - + g_free(gop_key); + delete_avpl(gopkey_match,TRUE); return; } } @@ -700,9 +702,11 @@ static void get_pdu_fields(gpointer k, gpointer v, gpointer p) { if (curr_range->end >= end && curr_range->start <= start) { avp = new_avp_from_finfo(name, fi); - s = avp_to_str(avp); - dbg_print(dbg_pdu,5,dbg_facility,"get_pdu_fields: got %s",s); - g_free(s); + if (*dbg_pdu > 4) { + s = avp_to_str(avp); + dbg_print(dbg_pdu,5,dbg_facility,"get_pdu_fields: got %s",s); + g_free(s); + } if (! insert_avp(data->pdu->avpl,avp) ) { delete_avp(avp); diff --git a/plugins/mate/mate_util.c b/plugins/mate/mate_util.c index 547a63b418..baa865e532 100644 --- a/plugins/mate/mate_util.c +++ b/plugins/mate/mate_util.c @@ -212,7 +212,7 @@ void scs_unsubscribe(SCS_collection* c, guint8* s) { (*ip)--; } } else { - g_warning("unsusbcribe: already deleted: '%s'?",s); + g_warning("unsusbcribe: not subscribed"); } } |