--- a/libpurple/notify.c Tue Jun 01 17:36:18 2021 -0500
+++ b/libpurple/notify.c Tue Jun 01 17:36:33 2021 -0500
@@ -746,17 +746,21 @@
purple_notify_close_with_handle(void *handle)
- GList *l, *prev = NULL;
g_return_if_fail(handle != NULL);
ops = purple_notify_get_ui_ops();
- for (l = handles; l != NULL; l = prev ? prev->next : handles) {
- PurpleNotifyInfo *info = l->data;
+ PurpleNotifyInfo *info = (PurpleNotifyInfo *)l->data; - if (info->handle == handle) {
+ if(info != NULL && info->handle == handle) { + /* Move to the next item before we remove our current item. */ handles = g_list_remove(handles, info);
if (ops != NULL && ops->close_notify != NULL)
@@ -766,8 +770,9 @@
info->cb(info->cb_user_data);