diff options
author | Kent Mein <mein@cs.umn.edu> | 2006-10-24 20:42:12 +0400 |
---|---|---|
committer | Kent Mein <mein@cs.umn.edu> | 2006-10-24 20:42:12 +0400 |
commit | 00b2d4f052c9a35fd8d682344d00955eebb0eccc (patch) | |
tree | 4de310dcd2230b808daced4f0547e4a55026dd20 /intern | |
parent | 0360be49f5018dead60b0d2fd637d828420c830e (diff) |
Another bug found by klockwork.com
This one is just a simple test to make sure a malloc works before using
the variable allocated.
Kent
Diffstat (limited to 'intern')
-rw-r--r-- | intern/ghost/intern/GHOST_C-api.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_C-api.cpp b/intern/ghost/intern/GHOST_C-api.cpp index fbb4cca91e0..c2b8eca9573 100644 --- a/intern/ghost/intern/GHOST_C-api.cpp +++ b/intern/ghost/intern/GHOST_C-api.cpp @@ -497,6 +497,8 @@ char* GHOST_GetTitle(GHOST_WindowHandle windowhandle) window->getTitle(title); char *ctitle = (char*) malloc(title.Length() + 1); + + if (ctitle == NULL) return NULL; strcpy(ctitle, title.Ptr()); return ctitle; |