Fix resource leak that occur when finishing dbus call 46/282546/1
authorJaehyun Kim <jeik01.kim@samsung.com>
Wed, 5 Oct 2022 08:07:31 +0000 (17:07 +0900)
committerJaehyun Kim <jeik01.kim@samsung.com>
Wed, 5 Oct 2022 08:07:31 +0000 (17:07 +0900)
Change-Id: I2c0012b63ef601145685e32bcfd369819e8062af
Signed-off-by: Jaehyun Kim <jeik01.kim@samsung.com>
src/network_dbus.c

index aba1f66..e973600 100644 (file)
@@ -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;
                }