diff options
author | Ben Chan <benchan@chromium.org> | 2018-10-17 23:06:48 -0700 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2018-10-18 13:17:36 +0200 |
commit | 7de6b6f2e176ed60f1f74d0d8704f73e39585891 (patch) | |
tree | e7a8e4adb2c7b6cd9da12be4c281440f6a796bc6 /src/mm-modem-helpers.c | |
parent | 749b806c30b41512dec4901808976425cdf3e56b (diff) | |
download | ModemManager-7de6b6f2e176ed60f1f74d0d8704f73e39585891.tar.gz |
core: remove unnecessary NULL checks for g_match_info_free()
g_match_info_free() already check if the given pointer is NULL and does
nothing on a NULL pointer.
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r-- | src/mm-modem-helpers.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 296b9f3a0..7845edcff 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -1303,8 +1303,7 @@ mm_3gpp_parse_cops_read_response (const gchar *response, } out: - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (inner_error) { @@ -1608,8 +1607,7 @@ mm_3gpp_parse_cgact_read_response (const gchar *reply, g_match_info_next (match_info, &inner_error); } - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (inner_error) { @@ -2152,9 +2150,7 @@ mm_3gpp_parse_cgcontrdp_response (const gchar *response, dns_secondary_address = mm_get_string_unquoted_from_match_info (match_info, 7 + field_format_extra_index); out: - - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); g_free (local_address_and_subnet); @@ -2238,8 +2234,7 @@ mm_3gpp_parse_cfun_query_response (const gchar *response, *out_state = state; out: - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (inner_error) { @@ -2317,9 +2312,7 @@ mm_3gpp_parse_cesq_response (const gchar *response, } out: - - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); if (inner_error) { @@ -2725,8 +2718,7 @@ end: if (r != NULL) g_regex_unref (r); - if (match_info != NULL) - g_match_info_free (match_info); + g_match_info_free (match_info); return ret; } @@ -4321,9 +4313,7 @@ mm_parse_cclk_response (const char *response, ret = TRUE; out: - - if (match_info) - g_match_info_free (match_info); + g_match_info_free (match_info); g_regex_unref (r); return ret; |