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.
This commit is contained in:
Ben Chan
2018-10-17 23:06:48 -07:00
committed by Aleksander Morgado
parent 749b806c30
commit 7de6b6f2e1
12 changed files with 40 additions and 85 deletions

View File

@@ -147,8 +147,7 @@ mm_cinterion_parse_scfg_test (const gchar *response,
g_free (maxbandstr); g_free (maxbandstr);
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (!bands) if (!bands)
@@ -234,8 +233,7 @@ mm_cinterion_parse_scfg_response (const gchar *response,
g_free (currentstr); g_free (currentstr);
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (!bands) if (!bands)
@@ -341,8 +339,7 @@ mm_cinterion_parse_cnmi_test (const gchar *response,
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -457,8 +454,7 @@ mm_cinterion_parse_sind_response (const gchar *response,
} else } else
errors++; errors++;
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (errors > 0) { if (errors > 0) {

View File

@@ -257,8 +257,7 @@ mm_huawei_parse_dhcp_response (const char *reply,
} }
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return matched; return matched;
} }
@@ -324,8 +323,7 @@ mm_huawei_parse_sysinfo_response (const char *reply,
} }
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return matched; return matched;
} }
@@ -389,8 +387,7 @@ mm_huawei_parse_sysinfoex_response (const char *reply,
mm_get_uint_from_match_info (match_info, 8, out_sys_submode); mm_get_uint_from_match_info (match_info, 8, out_sys_submode);
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return matched; return matched;
} }
@@ -1257,8 +1254,7 @@ gboolean mm_huawei_parse_nwtime_response (const gchar *response,
} }
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return ret; return ret;
@@ -1329,8 +1325,7 @@ gboolean mm_huawei_parse_time_response (const gchar *response,
} }
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return ret; return ret;
@@ -1400,8 +1395,7 @@ mm_huawei_parse_hcsq_response (const gchar *response,
ret = TRUE; ret = TRUE;
done: done:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return ret; return ret;
@@ -1463,8 +1457,7 @@ mm_huawei_parse_cvoice_response (const gchar *response,
} }
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return ret; return ret;

View File

@@ -159,8 +159,7 @@ mm_mbm_parse_e2ipcfg_response (const gchar *response,
} }
done: done:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return !!*ip_config; return !!*ip_config;
} }

View File

@@ -122,8 +122,7 @@ load_unlock_retries_ready (MMBaseModem *self,
} }
g_object_unref (task); g_object_unref (task);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
} }
@@ -224,8 +223,7 @@ get_supported_modes_ready (MMBaseModem *self,
response); response);
g_regex_unref (r); g_regex_unref (r);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
return; return;
} }
@@ -280,9 +278,7 @@ get_supported_modes_ready (MMBaseModem *self,
g_object_unref (task); g_object_unref (task);
g_regex_unref (r); g_regex_unref (r);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
return;
} }
static void static void
@@ -412,8 +408,7 @@ load_current_modes_finish (MMIfaceModem *self,
done: done:
if (r) if (r)
g_regex_unref (r); g_regex_unref (r);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
return result; return result;
} }

View File

@@ -1158,8 +1158,7 @@ parse_nwltime_reply (const char *response,
else else
g_free (result); g_free (result);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return success; return success;
} }

View File

@@ -727,8 +727,7 @@ selrat_query_ready (MMBaseModem *self,
"Could not parse allowed mode response: Response didn't match: '%s'", "Could not parse allowed mode response: Response didn't match: '%s'",
response); response);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (error) { if (error) {
@@ -1382,8 +1381,7 @@ parse_time (const gchar *response,
} }
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return result; return result;
} }

View File

@@ -67,8 +67,7 @@ mm_sierra_parse_scact_read_response (const gchar *reply,
g_match_info_next (match_info, &inner_error); 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); g_regex_unref (r);
if (inner_error) { if (inner_error) {

View File

@@ -78,8 +78,7 @@ mm_ublox_parse_upincnt_response (const gchar *response,
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -144,8 +143,7 @@ mm_ublox_parse_uusbconf_response (const gchar *response,
g_free (profile_name); g_free (profile_name);
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -205,8 +203,7 @@ mm_ublox_parse_ubmconf_response (const gchar *response,
} }
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -292,8 +289,7 @@ mm_ublox_parse_uipaddr_response (const gchar *response,
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -982,8 +978,7 @@ mm_ublox_parse_uact_response (const gchar *response,
g_free (bandstr); g_free (bandstr);
} }
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -1097,8 +1092,7 @@ mm_ublox_parse_uact_test (const gchar *response,
out: out:
g_strfreev (split); g_strfreev (split);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -1229,8 +1223,7 @@ out:
g_free (allowed_str); g_free (allowed_str);
g_free (preferred_str); g_free (preferred_str);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -1449,8 +1442,7 @@ mm_ublox_parse_ugcntrd_response_for_cid (const gchar *response,
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {

View File

@@ -317,8 +317,7 @@ wwsm_read_ready (MMBaseModem *self,
g_object_unref (task); g_object_unref (task);
g_regex_unref (r); g_regex_unref (r);
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
} }
static void static void

View File

@@ -449,8 +449,7 @@ mm_xmm_parse_xact_query_response (const gchar *response,
/* success */ /* success */
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -672,9 +671,7 @@ mm_xmm_parse_xcesq_query_response (const gchar *response,
} }
out: out:
g_match_info_free (match_info);
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -996,8 +993,7 @@ mm_xmm_parse_xlcsslp_query_response (const gchar *response,
} }
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {

View File

@@ -405,8 +405,7 @@ load_current_modes_finish (MMIfaceModem *self,
g_assert_not_reached (); g_assert_not_reached ();
done: done:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
if (r) if (r)
g_regex_unref (r); g_regex_unref (r);

View File

@@ -1303,8 +1303,7 @@ mm_3gpp_parse_cops_read_response (const gchar *response,
} }
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -1608,8 +1607,7 @@ mm_3gpp_parse_cgact_read_response (const gchar *reply,
g_match_info_next (match_info, &inner_error); 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); g_regex_unref (r);
if (inner_error) { 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); dns_secondary_address = mm_get_string_unquoted_from_match_info (match_info, 7 + field_format_extra_index);
out: out:
g_match_info_free (match_info);
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
g_free (local_address_and_subnet); g_free (local_address_and_subnet);
@@ -2238,8 +2234,7 @@ mm_3gpp_parse_cfun_query_response (const gchar *response,
*out_state = state; *out_state = state;
out: out:
if (match_info) g_match_info_free (match_info);
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -2317,9 +2312,7 @@ mm_3gpp_parse_cesq_response (const gchar *response,
} }
out: out:
g_match_info_free (match_info);
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
if (inner_error) { if (inner_error) {
@@ -2725,8 +2718,7 @@ end:
if (r != NULL) if (r != NULL)
g_regex_unref (r); g_regex_unref (r);
if (match_info != NULL) g_match_info_free (match_info);
g_match_info_free (match_info);
return ret; return ret;
} }
@@ -4321,9 +4313,7 @@ mm_parse_cclk_response (const char *response,
ret = TRUE; ret = TRUE;
out: out:
g_match_info_free (match_info);
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r); g_regex_unref (r);
return ret; return ret;