From 78ed7415f58dba457fb86eec549cbf921441806b Mon Sep 17 00:00:00 2001 From: Myned Date: Tue, 2 Jun 2020 00:39:14 -0400 Subject: [PATCH] Fix allocation error --- src/linux/advanced-scene-switcher-nix.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/linux/advanced-scene-switcher-nix.cpp b/src/linux/advanced-scene-switcher-nix.cpp index 750fe32c..e124e5b4 100644 --- a/src/linux/advanced-scene-switcher-nix.cpp +++ b/src/linux/advanced-scene-switcher-nix.cpp @@ -193,10 +193,9 @@ static std::string GetWindowTitle(size_t i) { std::string str(name); windowTitle = str; + XFree(name); } - XFree(name); - return windowTitle; } @@ -262,9 +261,8 @@ void GetCurrentWindowTitle(string &title) if (status != 0 && name != nullptr) { std::string str(name); title = str; + XFree(name); } - - XFree(name); } pair getCursorPos()