From 3870edf376a1b4a7fa1c9d38f8952038a21cb55d Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Sun, 3 Dec 2017 09:38:32 +0000 Subject: [PATCH] Fixed leak and clean up formatting. --- src/osgPlugins/tga/ReaderWriterTGA.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/osgPlugins/tga/ReaderWriterTGA.cpp b/src/osgPlugins/tga/ReaderWriterTGA.cpp index 256beb603..861c61b70 100644 --- a/src/osgPlugins/tga/ReaderWriterTGA.cpp +++ b/src/osgPlugins/tga/ReaderWriterTGA.cpp @@ -405,6 +405,7 @@ int *numComponents_ret) break; default: tgaerror = ERR_UNSUPPORTED; + delete [] formattedMap; return NULL; /* unreachable code - (depth < 1 || depth > 4) rejected by "check for reasonable values in case this is not a tga file" near the start of this function*/ } @@ -415,8 +416,7 @@ int *numComponents_ret) dest += lineoffset; } - if (formattedMap) - delete[] formattedMap; + delete [] formattedMap; } break; case 2: /* RGB, uncompressed */