summaryrefslogtreecommitdiff
path: root/ui/qt5
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-16 14:50:56 -0600
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2019-12-16 14:50:56 -0600
commitbf86a55dd46aae173462137aa5a59d8e24516b83 (patch)
tree32261ba7982c195703143af6cdcd99831bca6f54 /ui/qt5
parentf2a0a2c30b257aa0fca5039f87aeadf247b8381d (diff)
downloadhorizon-bf86a55dd46aae173462137aa5a59d8e24516b83.tar.gz
horizon-bf86a55dd46aae173462137aa5a59d8e24516b83.tar.bz2
horizon-bf86a55dd46aae173462137aa5a59d8e24516b83.tar.xz
horizon-bf86a55dd46aae173462137aa5a59d8e24516b83.zip
Qt UI: Use stack for ssid/pass variables
Diffstat (limited to 'ui/qt5')
-rw-r--r--ui/qt5/netsimplewifipage.cc13
1 files changed, 6 insertions, 7 deletions
diff --git a/ui/qt5/netsimplewifipage.cc b/ui/qt5/netsimplewifipage.cc
index 9b77295..e6c2d8b 100644
--- a/ui/qt5/netsimplewifipage.cc
+++ b/ui/qt5/netsimplewifipage.cc
@@ -254,16 +254,17 @@ void NetworkSimpleWirelessPage::associate() {
connect(connNotify, &QSocketNotifier::activated,
this, &NetworkSimpleWirelessPage::processAssociateMessage);
- char *ssid, *pass;
+ const char *ssid, *pass;
+ std::string password, network;
if(passphrase->isHidden()) {
pass = nullptr;
} else {
- std::string password = ("\"" + passphrase->text().toStdString() + "\"");
- pass = strdup(password.c_str());
+ password = ("\"" + passphrase->text().toStdString() + "\"");
+ pass = password.c_str();
}
- std::string network = ("\"" + items[0]->text().toStdString() + "\"");
- ssid = strdup(network.c_str());
+ network = ("\"" + items[0]->text().toStdString() + "\"");
+ ssid = network.c_str();
tain_now_g();
if(wpactrl_associate_g(&control, ssid, pass) == 0) {
@@ -275,8 +276,6 @@ void NetworkSimpleWirelessPage::associate() {
dialog->setLabelText(tr("Associating..."));
}
- free(ssid);
- free(pass);
return;
}