- Fix changes freeing server domain list to use 'g_list_free_full' instead of for-loop
Change-Id: I0e54a96ed29505bbb1537f6779095d32314be075
Signed-off-by: Daniil Ruban <intx82@gmail.com>
{
GList *list;
int fd;
+ if (server == NULL)
+ return;
if (server->channel)
fd = g_io_channel_unix_get_fd(server->channel);
DBG("Removing DNS server %s", server->server);
g_free(server->server);
- for (list = server->domains; list; list = list->next) {
- char *domain = list->data;
- server->domains = g_list_remove(server->domains, domain);
- g_free(domain);
- }
+ g_list_free_full(server->domains, g_free);
+
g_free(server->server_addr);
/*