From 3e0a4e0eb1dd6d91a84d879d94fa6839c6439679 Mon Sep 17 00:00:00 2001 From: Evgeny Date: Thu, 23 Jul 2026 13:12:04 +0300 Subject: [PATCH] =?UTF-8?q?fix:=20=D0=B7=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0=20m?= =?UTF-8?q?alloc=20=D0=BD=D0=B0=20u=5Fstrdup=20=D0=B2=20channelSelected=20?= =?UTF-8?q?=E2=80=94=20u=5Ffree=20=D0=BF=D0=B0=D0=B4=D0=B0=D0=BB=20=D0=BD?= =?UTF-8?q?=D0=B0=20=D1=87=D1=83=D0=B6=D0=BE=D0=B9=20=D0=BF=D0=B0=D0=BC?= =?UTF-8?q?=D1=8F=D1=82=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/chatgui/src/mainwindow.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/chatgui/src/mainwindow.cpp b/tools/chatgui/src/mainwindow.cpp index 450f2069..fb50cecd 100644 --- a/tools/chatgui/src/mainwindow.cpp +++ b/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,