Skip to content

Commit

Permalink
cube: Fix use after free regression
Browse files Browse the repository at this point in the history
Coverity report:

CID 1366758:  Memory - corruptions  (USE_AFTER_FREE)
Calling "operator delete[]" frees pointer "label32"
 which has already been freed.

Commit f60ff4d fixed several memory leaks
but also added this wrong delete operation.

label32 is assigned to char_samp->label32_, so it is freed when deleting
char_samp.

Signed-off-by: Stefan Weil <[email protected]>
  • Loading branch information
stweil committed Dec 2, 2016
1 parent 4ac54a2 commit 4704fca
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion cube/char_samp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ CharSamp *CharSamp::FromCharDumpFile(CachedFile *fp) {
// load the Bmp8 part
if (char_samp->LoadFromCharDumpFile(fp) == false) {
delete char_samp;
delete [] label32;
return NULL;
}
return char_samp;
Expand Down

0 comments on commit 4704fca

Please sign in to comment.