From d702d7b335c0c9305e75131770c0ea739b70d813 Mon Sep 17 00:00:00 2001 From: Hein-Pieter van Braam Date: Wed, 28 Feb 2018 21:55:13 +0100 Subject: Fix various valgrind reported uninitialized variable uses --- platform/x11/os_x11.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'platform/x11/os_x11.cpp') 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) { -- cgit v1.2.3