add: tgaRowData = NULL;
context: translate_from_bits_to_tgatc(BPositionIO *inSource, 	BPositionIO *outDestination, color_space fromspace,	TGAImageSpec &imagespec, bool brle){	int32 bitsBytesPerPixel = 0;	switch (fromspace) {		case B_RGB32:		case B_RGB32_BIG:		case B_RGBA32:		case B_RGBA32_BIG:		case B_CMY32:		case B_CMYA32:		case B_CMYK32:			bitsBytesPerPixel = 4;			break;					case B_RGB24:		case B_RGB24_BIG:		case B_CMY24:			bitsBytesPerPixel = 3;			break;					case B_RGB16:		case B_RGB16_BIG:		case B_RGBA15:		case B_RGBA15_BIG:		case B_RGB15:		case B_RGB15_BIG:			bitsBytesPerPixel = 2;			break;					case B_CMAP8:		case B_GRAY8:			bitsBytesPerPixel = 1;			break;					default:			return B_ERROR;	}	int32 bitsRowBytes = imagespec.width * bitsBytesPerPixel;	uint8 tgaBytesPerPixel = (imagespec.depth / 8) +		((imagespec.depth % 8) ? 1 : 0);	int32 tgaRowBytes = (imagespec.width * tgaBytesPerPixel) +		(imagespec.width / 2);	uint32 tgapixrow = 0;	uint8 *tgaRowData = new uint8[tgaRowBytes];	if (!tgaRowData)		return B_ERROR;	uint8 *bitsRowData = new uint8[bitsRowBytes];	if (!bitsRowData) {		delete[] tgaRowData;		return B_ERROR;	}		// conversion function pointer, points to either	// RLE or normal TGA conversion function	status_t (*convert_to_tga)(uint8 *pbits, uint8 *ptga,		color_space fromspace, uint16 width, const color_map *pmap,		int32 bitsBytesPerPixel);			if (brle)		convert_to_tga = pix_bits_to_tgarle;	else		convert_to_tga = pix_bits_to_tga;		ssize_t rd = inSource->Read(bitsRowData, bitsRowBytes);	const color_map *pmap = system_colors();	while (rd == bitsRowBytes) {		status_t bytescopied;		bytescopied = convert_to_tga(bitsRowData, tgaRowData, fromspace,			imagespec.width, pmap, bitsBytesPerPixel);						outDestination->Write(tgaRowData, bytescopied);		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;		rd = inSource->Read(bitsRowData, bitsRowBytes);	} // while (rd == bitsRowBytes)		delete[] bitsRowData;	delete[] tgaRowData;	return B_OK;}