mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-30 06:10:11 +01:00
wwan/ofono: fix memory leak in handle_settings()
[thaller@redhat.com: modified original patch.] Fixes:58287cbcc0('core: rework IP configuration in NetworkManager using layer 3 configuration') (cherry picked from commit61e99ed715)
This commit is contained in:
parent
0797b26846
commit
a8813ff6fe
1 changed files with 6 additions and 5 deletions
|
|
@ -739,7 +739,7 @@ handle_settings(GVariant *v_dict, gpointer user_data)
|
|||
gboolean ret = FALSE;
|
||||
const char *interface;
|
||||
const char *s;
|
||||
const char **array;
|
||||
gs_free const char **array = NULL;
|
||||
guint32 address_network, gateway_network;
|
||||
int ifindex;
|
||||
GError *error = NULL;
|
||||
|
|
@ -838,15 +838,16 @@ handle_settings(GVariant *v_dict, gpointer user_data)
|
|||
}
|
||||
if (array) {
|
||||
gboolean any_good = FALSE;
|
||||
gsize i;
|
||||
|
||||
for (; array[0]; array++) {
|
||||
if (!nm_utils_parse_inaddr_bin(AF_INET, *array, NULL, &address_network)
|
||||
for (i = 0; array[i]; i++) {
|
||||
if (!nm_utils_parse_inaddr_bin(AF_INET, array[i], NULL, &address_network)
|
||||
|| !address_network) {
|
||||
_LOGW("invalid NameServer: %s", *array);
|
||||
_LOGW("invalid NameServer: %s", array[i]);
|
||||
continue;
|
||||
}
|
||||
any_good = TRUE;
|
||||
_LOGI("DNS: %s", *array);
|
||||
_LOGI("DNS: %s", array[i]);
|
||||
nm_l3_config_data_add_nameserver(priv->l3cd_4, AF_INET, &address_network);
|
||||
}
|
||||
if (!any_good) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue