config: fix memory leak in merge_no_auto_default_state()
This commit is contained in:
@@ -276,13 +276,17 @@ merge_no_auto_default_state (NMConfig *config)
|
|||||||
list = g_strsplit (data, "\n", -1);
|
list = g_strsplit (data, "\n", -1);
|
||||||
for (i = 0; list[i]; i++) {
|
for (i = 0; list[i]; i++) {
|
||||||
if (!*list[i])
|
if (!*list[i])
|
||||||
continue;
|
g_free (list[i]);
|
||||||
for (j = 0; j < updated->len; j++) {
|
else {
|
||||||
if (!strcmp (list[i], updated->pdata[j]))
|
for (j = 0; j < updated->len; j++) {
|
||||||
break;
|
if (!strcmp (list[i], updated->pdata[j]))
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (j == updated->len)
|
||||||
|
g_ptr_array_add (updated, list[i]);
|
||||||
|
else
|
||||||
|
g_free (list[i]);
|
||||||
}
|
}
|
||||||
if (j == updated->len)
|
|
||||||
g_ptr_array_add (updated, list[i]);
|
|
||||||
}
|
}
|
||||||
g_free (list);
|
g_free (list);
|
||||||
g_free (data);
|
g_free (data);
|
||||||
|
Reference in New Issue
Block a user