fix: замена malloc на u_strdup в channelSelected — u_free падал на чужой памяти

This commit is contained in:
Evgeny committed 2026-07-23 13:12:04 +03:00
1 parent 0e324cf36d
commit 3e0a4e0eb1
1 file changed
+2 -3
+2 -3
View File
@@ -181,9 +181,8 @@ MainWindow::MainWindow(QWidget *parent, DbManager* db, const QString& cfgPath,
m_accountList->setChannel(channelId);
QByteArray cidBA = channelId.toUtf8();
char* cid = (char*)malloc(cidBA.size() + 1);
if (cid) { memcpy(cid, cidBA.constData(), cidBA.size()); cid[cidBA.size()] = '\0';
gui_bridge_post_uasync_fn(chat_core_connect_channel_trampoline, cid); }
char* cid = u_strdup(cidBA.constData());
if (cid) gui_bridge_post_uasync_fn(chat_core_connect_channel_trampoline, cid);
});
connect(m_channelList, &ChannelList::inviteRequested,