I also had a wrestle with the image library I'm using, FreeImage. I recently started to enlarge my npot textures to be pot sizes with the command FreeImage_Enlarge:
bmp=FreeImage_EnlargeCanvas(bmp, 0, padY, padX, 0, &paddingColor, FI_COLOR_IS_RGB_COLOR);I found out I had been assigning the bitmap instance that I also used as an input parameter to the enlargement function. This apparently causes a memory leak. I do this enlargement because older graphic cards and some built in chips doesn't always support npot textures (laptops and notebooks). The issue was fixed by using two bitmaps.
While doing this I wish I had a decent memory leak detection tool. I haven't found any that works with Code::Blocks (only found VC++ libs). I would be interested if anyone knows if any such tool/library exists.