diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-12-16 14:50:56 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-12-16 14:50:56 -0600 |
commit | bf86a55dd46aae173462137aa5a59d8e24516b83 (patch) | |
tree | 32261ba7982c195703143af6cdcd99831bca6f54 | |
parent | f2a0a2c30b257aa0fca5039f87aeadf247b8381d (diff) | |
download | horizon-bf86a55dd46aae173462137aa5a59d8e24516b83.tar.gz horizon-bf86a55dd46aae173462137aa5a59d8e24516b83.tar.bz2 horizon-bf86a55dd46aae173462137aa5a59d8e24516b83.tar.xz horizon-bf86a55dd46aae173462137aa5a59d8e24516b83.zip |
Qt UI: Use stack for ssid/pass variables
-rw-r--r-- | ui/qt5/netsimplewifipage.cc | 13 |
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; } |