From fa65449b0ea8977b6ab0bcee7dab763620e8302e Mon Sep 17 00:00:00 2001 From: Cheoleun Moon Date: Thu, 13 Feb 2020 13:38:58 +0900 Subject: [PATCH] Assign NULL after free Change-Id: I51d2ba6fcb73f3a6a8e15a3eb85b610a46316fc9 Signed-off-by: Cheoleun Moon --- dvpnlib/src/dvpnlib-vpn-connnection.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dvpnlib/src/dvpnlib-vpn-connnection.c b/dvpnlib/src/dvpnlib-vpn-connnection.c index ea364fa..3473a89 100755 --- a/dvpnlib/src/dvpnlib-vpn-connnection.c +++ b/dvpnlib/src/dvpnlib-vpn-connnection.c @@ -264,9 +264,11 @@ static void parse_connection_property_user_routes( 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; @@ -334,9 +336,11 @@ static void parse_connection_property_server_routes( 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; -- 2.34.1