Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward <edward88>2022-10-21 16:35:20 +0300
committerJeroen Bakker <jeroen@blender.org>2022-10-21 16:35:30 +0300
commit4776a74bf7f1ed60efee22290c5fea732d7e2e5a (patch)
treede2b272b9b8efef6d1493fd7ca57c40a71c6518b
parentec60c8abe76e4473f45d783010be92114c0ed608 (diff)
Fix T101974: Potential memoryleak GHOST_WindowWayland.newDrawingContext
Reviewed By: jbakker Maniphest Tasks: T101974 Differential Revision: https://developer.blender.org/D16309
-rw-r--r--intern/ghost/intern/GHOST_WindowWayland.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/ghost/intern/GHOST_WindowWayland.cpp b/intern/ghost/intern/GHOST_WindowWayland.cpp
index b29c5efd8d4..986e18d7a87 100644
--- a/intern/ghost/intern/GHOST_WindowWayland.cpp
+++ b/intern/ghost/intern/GHOST_WindowWayland.cpp
@@ -946,7 +946,12 @@ GHOST_Context *GHOST_WindowWayland::newDrawingContext(GHOST_TDrawingContextType
EGL_OPENGL_API);
}
- return (context->initializeDrawingContext() == GHOST_kSuccess) ? context : nullptr;
+ if (context->initializeDrawingContext()) {
+ return context;
+ }
+
+ delete context;
+ return nullptr;
}
/** \} */