Creating bitmaps before loading.

Description

Creating bitmaps before loading.
         BITMAP *image = create_bitmap(width, height);
         image = load_bitmap("image.bmp", pal);


When loading a bitmap, Allegro will automatically create a bitmap big enough to store it. In the above code the address returned by create_bitmap() is overwritten by the second assignment statement, to the return value of the call to load_bitmap(). Since the address of the first (unnecessary) bitmap has been lost, there is no way to destroy it so there is a memory leak.