diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-19 15:32:50 -0600 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2019-11-19 15:32:50 -0600 |
commit | 3767b1088890959147b8d3e0dbf63e472f2fac96 (patch) | |
tree | eb795632f5402db9b089fd3a8c1185725b02001a /ui/qt5/inputpage.cc | |
parent | d37840b32f0baaf497fc3c5bdf8dcf7210332a76 (diff) | |
download | horizon-3767b1088890959147b8d3e0dbf63e472f2fac96.tar.gz horizon-3767b1088890959147b8d3e0dbf63e472f2fac96.tar.bz2 horizon-3767b1088890959147b8d3e0dbf63e472f2fac96.tar.xz horizon-3767b1088890959147b8d3e0dbf63e472f2fac96.zip |
Qt UI: Fix small memory leak issues
Diffstat (limited to 'ui/qt5/inputpage.cc')
-rw-r--r-- | ui/qt5/inputpage.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/ui/qt5/inputpage.cc b/ui/qt5/inputpage.cc index 2807c02..4717300 100644 --- a/ui/qt5/inputpage.cc +++ b/ui/qt5/inputpage.cc @@ -91,10 +91,14 @@ void InputPage::initializePage() { /* Select the current keyboard layout, if available. */ Display *dpy = XOpenDisplay(nullptr); if(dpy != nullptr) { - XkbRF_VarDefsRec vardefs; + XkbRF_VarDefsRec vardefs{}; XkbRF_GetNamesProp(dpy, nullptr, &vardefs); QList<QListWidgetItem *> items = layoutList->findItems(vardefs.layout, Qt::MatchExactly); if(!items.empty()) layoutList->setCurrentItem(items.at(0)); + free(vardefs.model); + free(vardefs.layout); + free(vardefs.variant); + free(vardefs.options); XCloseDisplay(dpy); } #endif /* HAS_INSTALL_ENV */ |