1
0
Fork 0

Merge pull request #1856 from profanity-im/fix-1855

Fix double-free of values.
This commit is contained in:
Michael Vetter 2023-06-05 08:17:34 +02:00 committed by GitHub
commit d761e88ee6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -2798,6 +2798,12 @@ _mam_rsm_id_handler(xmpp_stanza_t* const stanza, void* const userdata)
MamRsmUserdata* ndata = malloc(sizeof(*ndata));
*ndata = *data;
if (data->end_datestr)
ndata->end_datestr = strdup(data->end_datestr);
if (data->start_datestr)
ndata->start_datestr = strdup(data->start_datestr);
if (data->barejid)
ndata->barejid = strdup(data->barejid);
iq_id_handler_add(xmpp_stanza_get_id(iq), _mam_rsm_id_handler, (ProfIqFreeCallback)_mam_userdata_free, ndata);
iq_send_stanza(iq);