From: Jaehyun Kim Date: Wed, 5 Oct 2022 08:07:31 +0000 (+0900) Subject: Fix resource leak that occur when finishing dbus call X-Git-Tag: accepted/tizen/7.0/unified/20230126.170237~15 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F46%2F282546%2F1;p=platform%2Fcore%2Fapi%2Fwifi-manager.git Fix resource leak that occur when finishing dbus call Change-Id: I2c0012b63ef601145685e32bcfd369819e8062af Signed-off-by: Jaehyun Kim --- diff --git a/src/network_dbus.c b/src/network_dbus.c index aba1f66..e973600 100644 --- a/src/network_dbus.c +++ b/src/network_dbus.c @@ -416,6 +416,7 @@ static void __net_scan_reply(GObject *source_object, GAsyncResult *res, gpointer if (error->code == G_IO_ERROR_CANCELLED) { WIFI_LOG(WIFI_INFO, "Ignore scan reply, as operation is cancelled"); g_error_free(error); + g_free(event_data); __NETWORK_FUNC_EXIT__; return; } @@ -522,6 +523,7 @@ static void __net_close_connection_reply(GObject *source_object, GAsyncResult *r if (error->code == G_IO_ERROR_CANCELLED) { WIFI_LOG(WIFI_INFO, "Ignore close connection reply, as operation is cancelled"); g_error_free(error); + g_free(event_data); __NETWORK_FUNC_EXIT__; return; } @@ -595,6 +597,7 @@ static void __net_wifi_power_reply(GObject *source_object, GAsyncResult *res, gp if (error->code == G_IO_ERROR_CANCELLED) { WIFI_LOG(WIFI_INFO, "Ignore wifi power reply, as operation is cancelled"); g_error_free(error); + g_free(event_data); __NETWORK_FUNC_EXIT__; return; } @@ -729,6 +732,7 @@ static void __net_netlink_scan_wifi_reply(GObject *source_object, GAsyncResult * if (error->code == G_IO_ERROR_CANCELLED) { WIFI_LOG(WIFI_INFO, "Ignore netlink scan reply, as operation is cancelled"); g_error_free(error); + g_free(event_data); __NETWORK_FUNC_EXIT__; return; } @@ -2076,6 +2080,7 @@ static void __net_specific_scan_request_reply(GObject *source_object, GAsyncResu if (error->code == G_IO_ERROR_CANCELLED) { WIFI_LOG(WIFI_INFO, "Ignore specific scan request reply, as operation is cancelled"); g_error_free(error); + g_free(event_data); __NETWORK_FUNC_EXIT__; return; } @@ -2689,6 +2694,7 @@ static void __net_wps_connect_wifi_reply(GObject *source_object, if (error->code == G_IO_ERROR_CANCELLED) { WIFI_LOG(WIFI_INFO, "Ignore wps connect reply, as operation is cancelled"); g_error_free(error); + g_free(event_data); __NETWORK_FUNC_EXIT__; return; } @@ -4002,6 +4008,7 @@ static void __net_multi_scan_request_reply(GObject *source_object, GAsyncResult if (error->code == G_IO_ERROR_CANCELLED) { WIFI_LOG(WIFI_INFO, "Ignore multi scan request reply, as operation is cancelled"); g_error_free(error); + g_free(event_data); __NETWORK_FUNC_EXIT__; return; }