summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-02-28 22:12:09 +0100
committerGitHub <noreply@github.com>2018-02-28 22:12:09 +0100
commit77e8cb2655e877c2e2da7bc8f3b87b184fef5fb3 (patch)
tree19e65ebbcc65823ab297a1e43f4adfb9c88dda44 /platform
parentc6dff58f491c30ffc2a81a8d69da86ff8105053f (diff)
parentd702d7b335c0c9305e75131770c0ea739b70d813 (diff)
Merge pull request #17117 from hpvb/fix-use-uninitialized-redux
Fix various valgrind reported uninitialized variable uses
Diffstat (limited to 'platform')
-rw-r--r--platform/x11/os_x11.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 66c02561b5..c5f8e7c3c9 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -1193,6 +1193,7 @@ bool OS_X11::is_window_maximized() const {
unsigned long len;
unsigned long remaining;
unsigned char *data = NULL;
+ bool retval = false;
int result = XGetWindowProperty(
x11_display,
@@ -1221,13 +1222,15 @@ bool OS_X11::is_window_maximized() const {
if (atoms[i] == wm_max_vert)
found_wm_max_vert = true;
- if (found_wm_max_horz && found_wm_max_vert)
- return true;
+ if (found_wm_max_horz && found_wm_max_vert) {
+ retval = true;
+ break;
+ }
}
- XFree(atoms);
}
- return false;
+ XFree(data);
+ return retval;
}
void OS_X11::set_window_always_on_top(bool p_enabled) {