Fix memory leak
authorHwankyu Jhun <h.jhun@samsung.com>
Mon, 2 Nov 2020 04:25:48 +0000 (13:25 +0900)
committerHwankyu Jhun <h.jhun@samsung.com>
Mon, 2 Nov 2020 05:04:57 +0000 (14:04 +0900)
Change-Id: I4af76ef1306f1e9752714552d10ff996b3d32f1d
Signed-off-by: Hwankyu Jhun <h.jhun@samsung.com>
src/notification_service.c

index ad55032..88dd344 100644 (file)
@@ -1506,14 +1506,17 @@ int notification_del_noti_multiple(GVariant *parameters, GVariant **reply_body,
                g_variant_unref(deleted_noti_list);
                if (ret != NOTIFICATION_ERROR_NONE) {
                        ERR("Failed to send notify [%d]", ret);
+                       free(list_deleted);
                        return ret;
                }
 
                for (i = 0; i < num_deleted; i++) {
                        notification_remove_private_sharing(app_id, *(list_deleted + i), param_uid);
                        ret = __delete_sender_info(*(list_deleted + i));
-                       if (ret != NOTIFICATION_ERROR_NONE)
+                       if (ret != NOTIFICATION_ERROR_NONE) {
+                               free(list_deleted);
                                return ret;
+                       }
                }
 
                free(list_deleted);