summaryrefslogtreecommitdiff
path: root/platform/x11/godot_x11.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-08-27 02:10:41 +0200
committerGitHub <noreply@github.com>2017-08-27 02:10:41 +0200
commitea55b400d908c01345a974cae82d8a8720e9904d (patch)
tree8aaa8da4196f5c4294185dfc411303073b015aab /platform/x11/godot_x11.cpp
parent5976e8d7ded314e56a2bb80406ea7eee9354e80c (diff)
parentbd257153dc9748bd9ab3f580437c3a28cc5348ab (diff)
Merge pull request #10598 from Rubonnek/free-memory
Free memory when Main::setup returns an error
Diffstat (limited to 'platform/x11/godot_x11.cpp')
-rw-r--r--platform/x11/godot_x11.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/platform/x11/godot_x11.cpp b/platform/x11/godot_x11.cpp
index 6f418b213f..f02f3cb881 100644
--- a/platform/x11/godot_x11.cpp
+++ b/platform/x11/godot_x11.cpp
@@ -45,8 +45,10 @@ int main(int argc, char *argv[]) {
getcwd(cwd, PATH_MAX);
Error err = Main::setup(argv[0], argc - 1, &argv[1]);
- if (err != OK)
+ if (err != OK) {
+ free(cwd);
return 255;
+ }
if (Main::start())
os.run(); // it is actually the OS that decides how to run