add: bitsRowData = NULL;
context: translate_from_tganm_to_bits(BPositionIO *inSource,	BPositionIO *outDestination, TGAImageSpec &imagespec){	bool bvflip;	if (imagespec.descriptor & TGA_ORIGIN_VERT_BIT)		bvflip = false;	else		bvflip = true;	uint8 nalpha = imagespec.descriptor & TGA_DESC_ALPHABITS;	int32 bitsRowBytes = imagespec.width * 4;	uint8 tgaBytesPerPixel = (imagespec.depth / 8) +		((imagespec.depth % 8) ? 1 : 0);	int32 tgaRowBytes = (imagespec.width * tgaBytesPerPixel);	uint32 tgapixrow = 0;		// Setup outDestination so that it can be written to	// from the end of the file to the beginning instead of	// the other way around	off_t bitsFileSize = (bitsRowBytes * imagespec.height) + 		sizeof(TranslatorBitmap);	if (outDestination->SetSize(bitsFileSize) != B_OK)		// This call should work for BFile and BMallocIO objects,		// but may not work for other BPositionIO based types		return B_ERROR;	off_t bitsoffset = (imagespec.height - 1) * bitsRowBytes;	if (bvflip)		outDestination->Seek(bitsoffset, SEEK_CUR);		// allocate row buffers	uint8 *tgaRowData = new uint8[tgaRowBytes];	if (!tgaRowData)		return B_ERROR;	uint8 *bitsRowData = new uint8[bitsRowBytes];	if (!bitsRowData) {		delete[] tgaRowData;		return B_ERROR;	}	// perform the actual translation	memset(bitsRowData, 0xff, bitsRowBytes);	ssize_t rd = inSource->Read(tgaRowData, tgaRowBytes);	while (rd == tgaRowBytes) {		pix_tganm_to_bits(bitsRowData, tgaRowData,			imagespec.width, imagespec.depth, 			tgaBytesPerPixel, nalpha);						outDestination->Write(bitsRowData, bitsRowBytes);		tgapixrow++;		// if I've read all of the pixel data, break		// out of the loop so I don't try to read 		// non-pixel data		if (tgapixrow == imagespec.height)			break;		if (bvflip)			outDestination->Seek(-(bitsRowBytes * 2), SEEK_CUR);		rd = inSource->Read(tgaRowData, tgaRowBytes);	}		delete[] tgaRowData;	delete[] bitsRowData;	return B_OK;}