From bdd60a4941b5e8948dd6397208f1ac4cfee61907 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Sun, 11 Oct 2009 11:31:23 -0700 Subject: [PATCH] cdma: fix memory leak parsing serving system results --- src/mm-generic-cdma.c | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/src/mm-generic-cdma.c b/src/mm-generic-cdma.c index 1cfa924f..942834db 100644 --- a/src/mm-generic-cdma.c +++ b/src/mm-generic-cdma.c @@ -738,11 +738,25 @@ serving_system_done (MMSerialPort *port, g_regex_match (r, reply, 0, &match_info); if (g_match_info_get_match_count (match_info) >= 3) { - class = normalize_class (g_match_info_fetch (match_info, 1)); - band = normalize_band (g_match_info_fetch (match_info, 2), &override_class); + char *str; + + /* band class */ + str = g_match_info_fetch (match_info, 1); + class = normalize_class (str); + g_free (str); + + /* band */ + str = g_match_info_fetch (match_info, 2); + band = normalize_band (str, &override_class); if (override_class) class = override_class; - sid = normalize_sid (g_match_info_fetch (match_info, 3)); + g_free (str); + + /* sid */ + str = g_match_info_fetch (match_info, 3); + sid = normalize_sid (str); + g_free (str); + success = TRUE; }