visual studio 2010 - Coverity issue for deleting void pointer -


coverity has pointed out bug deleting void pointer. code 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 please me on incorrect , how can solve it?

many thanks

best regards

chintan

just use char* type of pbits.


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -