Author: pulkomandy Date: 2010-08-12 14:39:39 +0200 (Thu, 12 Aug 2010) New Revision: 38048 Changeset: http://dev.haiku-os.org/changeset/38048 Modified: haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp Log: CID 903 : Memory leak on error. Modified: haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp =================================================================== --- haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp 2010-08-12 12:35:23 UTC (rev 38047) +++ haiku/trunk/src/add-ons/translators/tga/TGATranslator.cpp 2010-08-12 12:39:39 UTC (rev 38048) @@ -875,8 +875,11 @@ const color_map *pmap = NULL; if (fromspace == B_CMAP8) { pmap = system_colors(); - if (!pmap) + if (!pmap) { + delete[] tgaRowData; + delete[] bitsRowData; return B_ERROR; + } } while (rd == bitsRowBytes) { status_t bytescopied;