aboutsummaryrefslogtreecommitdiff
path: root/plugins/mm-modem-anydata-cdma.c
diff options
context:
space:
mode:
authorNathan Williams <njw@chromium.org>2011-09-27 13:40:39 -0500
committerDan Williams <dcbw@redhat.com>2011-09-27 13:40:39 -0500
commit8710820156f51d1861b329e6fc12e706304ddda9 (patch)
tree21fd334c5023fc0aa15a4023b5b10177a6e51ba4 /plugins/mm-modem-anydata-cdma.c
parent00670456ffb4b08af3620a95c73601bc15d84eb9 (diff)
core: ensure that GMatchInfo and GRegex objects are freed properly
In particular, g_regex_match() and g_regex_match_full() allocate a match_info structure on both success and failure, so calling g_match_info_free() only in the success case is insufficient. BUG=None TEST=Inspection Change-Id: Iea76b5b5dc3ec48120e15601a5e2dd45322133d8
Diffstat (limited to 'plugins/mm-modem-anydata-cdma.c')
-rw-r--r--plugins/mm-modem-anydata-cdma.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/mm-modem-anydata-cdma.c b/plugins/mm-modem-anydata-cdma.c
index 7b6b37a2..d26d3ec0 100644
--- a/plugins/mm-modem-anydata-cdma.c
+++ b/plugins/mm-modem-anydata-cdma.c
@@ -183,6 +183,9 @@ evdo_state_done (MMAtSerialPort *port,
}
}
+ g_match_info_free (match_info);
+ g_regex_unref (r);
+
done:
mm_generic_cdma_query_reg_state_set_callback_evdo_state (info, reg_state);
mm_callback_info_schedule (info);
@@ -254,6 +257,9 @@ state_done (MMAtSerialPort *port,
}
}
+ g_match_info_free (match_info);
+ g_regex_unref (r);
+
mm_generic_cdma_query_reg_state_set_callback_1x_state (info, reg_state);
/* Try for EVDO state too */