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,7 +147,6 @@ mm_cinterion_parse_scfg_test (const gchar *response,
g_free (maxbandstr);
}
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);
@@ -234,7 +233,6 @@ mm_cinterion_parse_scfg_response (const gchar *response,
g_free (currentstr);
}
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);
@@ -341,7 +339,6 @@ mm_cinterion_parse_cnmi_test (const gchar *response,
out:
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);
@@ -457,7 +454,6 @@ mm_cinterion_parse_sind_response (const gchar *response,
} else
errors++;
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -67,7 +67,6 @@ mm_sierra_parse_scact_read_response (const gchar *reply,
g_match_info_next (match_info, &inner_error);
}
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);

View File

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

View File

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

View File

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

View File

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

View File

@@ -1303,7 +1303,6 @@ mm_3gpp_parse_cops_read_response (const gchar *response,
}
out:
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);
@@ -1608,7 +1607,6 @@ 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_regex_unref (r);
@@ -2152,8 +2150,6 @@ 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_regex_unref (r);
@@ -2238,7 +2234,6 @@ mm_3gpp_parse_cfun_query_response (const gchar *response,
*out_state = state;
out:
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);
@@ -2317,8 +2312,6 @@ mm_3gpp_parse_cesq_response (const gchar *response,
}
out:
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);
@@ -2725,7 +2718,6 @@ end:
if (r != NULL)
g_regex_unref (r);
if (match_info != NULL)
g_match_info_free (match_info);
return ret;
@@ -4321,8 +4313,6 @@ mm_parse_cclk_response (const char *response,
ret = TRUE;
out:
if (match_info)
g_match_info_free (match_info);
g_regex_unref (r);