Coverity has pointed out a bug about deleting void pointer. The code is as below:
void *pbits=(void *)new char[((bmp.bmWidth*bitspixel+31)/32)*bmp.bmHeight*4];
result=GetDIBits(pDC->GetSafeHdc(),HBITMAP(*pbitmap),0,bmp.bmHeight,pbits,bitmapinfo,DIB_RGB_COLORS);
char curdir[100];
if(!GetCurrentDirectory(100,curdir))
{
delete [] pbits;
return;
}
Can you please help me on what is incorrect and how can I solve it?
Many thanks
Best Regards
Chintan