Browse Source

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

topo_upd
Evgeny 2 months ago
parent
commit
3e0a4e0eb1
  1. 5
      tools/chatgui/src/mainwindow.cpp

5
tools/chatgui/src/mainwindow.cpp

@ -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,

Loading…
Cancel
Save