aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mate/mate_runtime.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2005-02-07 08:54:24 +0000
committerAnders Broman <anders.broman@ericsson.com>2005-02-07 08:54:24 +0000
commitbc04baef424c0dd1cb25ae1a6d17d1bae1f629c8 (patch)
treefbd75bd036f33261d070221134851a8bd6605b1f /plugins/mate/mate_runtime.c
parent82908eac116934e4d7b10e900d28f4993582f9fe (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/mate_runtime.c')
-rw-r--r--plugins/mate/mate_runtime.c20
1 files changed, 12 insertions, 8 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);