diff options
author | Aleksander Morgado <aleksander@lanedo.com> | 2012-02-29 16:51:50 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@lanedo.com> | 2012-02-29 16:51:50 +0100 |
commit | bc118aa1602b309101f1151805a2d8cdf0f916eb (patch) | |
tree | 821fe022e89e1e383fafcaf0f433fc4587c0bc24 | |
parent | 30e706309462f6b207753209649143902ee538fa (diff) |
modem-helpers: plug memleak
g_match_info_fetch() returns always a heap-allocated string which should be
freed by the caller.
-rw-r--r-- | src/mm-modem-helpers.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 1feebc9e..9a722368 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -910,9 +910,10 @@ mm_gsm_parse_clck_test_response (const char *reply, if (g_regex_match_full (r, p, strlen (p), 0, 0, &match_info, NULL)) { while (g_match_info_matches (match_info)) { str = g_match_info_fetch (match_info, 1); - if (str) + if (str) { facilities |= mm_gsm_string_to_facility (str); - g_free (str); + g_free (str); + } g_match_info_next (match_info, NULL); success = TRUE; @@ -956,6 +957,8 @@ mm_gsm_parse_clck_response (const char *reply, gboolean *enabled) *enabled = TRUE; else success = FALSE; + + g_free (str); } } g_match_info_free (match_info); @@ -1271,4 +1274,3 @@ done: return array; } - |