From 04a7f6784d8c9cd9170f1855c9ed8b05e1179bee Mon Sep 17 00:00:00 2001 From: Jaehyun Kim Date: Wed, 5 Oct 2022 17:07:31 +0900 Subject: [PATCH] Fix resource leak that occur when finishing dbus call Change-Id: I2c0012b63ef601145685e32bcfd369819e8062af Signed-off-by: Jaehyun Kim --- src/network_dbus.c | 7 +++++++ 1 file changed, 7 insertions(+) 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; } -- 2.7.4