mirror of
https://forge.fsky.io/lda/Parsee.git
synced 2026-03-13 21:05:10 +00:00
[FIX] Fix use-after-free on DMs
This commit is contained in:
parent
14c67c6f9e
commit
4bcf1db4ec
3 changed files with 10 additions and 3 deletions
|
|
@ -143,11 +143,11 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
|
|||
ref = DbLock(data->db, 3, "rooms", id, "data");
|
||||
json = DbJson(ref);
|
||||
direct = JsonValueAsBoolean(HashMapGet(json, "is_direct"));
|
||||
DbUnlock(data->db, ref);
|
||||
|
||||
if (ParseeIsPuppet(data->config, sender) ||
|
||||
ParseeManageBan(data, sender, id))
|
||||
{
|
||||
DbUnlock(data->db, ref);
|
||||
Free(chat_id);
|
||||
Free(reply_id);
|
||||
Free(xepd);
|
||||
|
|
@ -158,6 +158,7 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
|
|||
{
|
||||
ParseeBotHandler(data, event);
|
||||
|
||||
DbUnlock(data->db, ref);
|
||||
Free(chat_id);
|
||||
Free(reply_id);
|
||||
Free(xepd);
|
||||
|
|
@ -172,6 +173,7 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
|
|||
|
||||
XMPPSendPlain(jabber, local, user, body, NULL, NULL, NULL, ev_id, NULL);
|
||||
|
||||
DbUnlock(data->db, ref);
|
||||
Free(chat_id);
|
||||
Free(local);
|
||||
Free(reply_id);
|
||||
|
|
@ -179,6 +181,7 @@ ParseeMessageHandler(ParseeData *data, HashMap *event)
|
|||
return;
|
||||
}
|
||||
|
||||
DbUnlock(data->db, ref);
|
||||
/* Try to find the chat ID */
|
||||
muc_id = ParseeGetMUCID(data, chat_id);
|
||||
if (!chat_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue