if (connection->user_routes == NULL) {
ERROR("connection->server_routes is NULL");
return;
- } else
+ } else {
g_slist_free_full(connection->user_routes,
free_vpn_connection_route);
+ connection->user_routes = NULL;
+ }
while (g_variant_iter_loop(&outer, "(a{sv})", &route_entry)) {
gchar *key;
if (connection->server_routes == NULL) {
ERROR("connection->server_routes is NULL");
return;
- } else
+ } else {
g_slist_free_full(connection->server_routes,
free_vpn_connection_route);
+ connection->server_routes = NULL;
+ }
while (g_variant_iter_loop(&outer, "(a{sv})", &route_entry)) {
gchar *key;