make duplicated struct for event callback for safety
authorSukhyungKang <shine.kang@samsung.com>
Wed, 13 Nov 2024 05:42:31 +0000 (14:42 +0900)
committerSukhyungKang <shine.kang@samsung.com>
Wed, 13 Nov 2024 06:56:21 +0000 (15:56 +0900)
Change-Id: Ia221137f029821e52f37ac7510b72da41dd9741b
Signed-off-by: SukhyungKang <shine.kang@samsung.com>
notification/src/notification_internal.c

index ff5bf5d79b83462e2c225c1888d5186bb306a84e..15d6f8fb898a3aad8d6fca947d8f718adf9148a1 100644 (file)
@@ -180,6 +180,7 @@ void notification_call_event_handler_cb(notification_h noti, int event_type)
        int priv_id;
        GList *find_list;
        notification_event_cb_info_s *info;
+       notification_event_cb_info_s dup_info;
 
        WARN("call event[%d]", event_type);
 
@@ -202,12 +203,14 @@ void notification_call_event_handler_cb(notification_h noti, int event_type)
                return;
        }
 
+       info = g_list_nth_data(find_list, 0);
+       dup_info = *info;
+
        __notification_mutex_unlock();
 
        WARN("call event callback");
 
-       info = g_list_nth_data(find_list, 0);
-       info->cb(noti, event_type, info->userdata);
+       dup_info.cb(noti, event_type, dup_info.userdata);
 
        WARN("done");
 }