mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-24 16:23:40 +01:00
Avoid orphan_item leak on affiliation/subscription removal (#1563)
This commit is contained in:
parent
bc9f178b6d
commit
720741b725
@ -707,7 +707,13 @@ del_state(#pubsub_state{stateid = {Key, Nidx}, items = Items}) ->
|
||||
[] ->
|
||||
ok;
|
||||
_ ->
|
||||
Orphan = #pubsub_orphan{nodeid = Nidx, items = Items},
|
||||
Orphan = #pubsub_orphan{nodeid = Nidx, items =
|
||||
case mnesia:read({pubsub_orphan, Nidx}) of
|
||||
[#pubsub_orphan{items = ItemIds}] ->
|
||||
lists:usort(ItemIds++Items);
|
||||
_ ->
|
||||
Items
|
||||
end},
|
||||
mnesia:write(Orphan)
|
||||
end,
|
||||
mnesia:delete({pubsub_state, {Key, Nidx}}).
|
||||
|
Loading…
Reference in New Issue
Block a user