'Cruft' removal (removed GAME_FNIGGIUM)
authorsajt <sajt@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 25 Mar 2006 07:25:45 +0000 (07:25 +0000)
committersajt <sajt@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 25 Mar 2006 07:25:45 +0000 (07:25 +0000)
Fixed a very minor 'potential' leak in JPEG loading

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@6186 d7cf8633-e32d-0410-b094-e92efae38249

common.c
common.h
jpeg.c

index efea485..a510c06 100644 (file)
--- a/common.c
+++ b/common.c
@@ -1002,9 +1002,6 @@ static const gamemode_info_t gamemode_info [] =
 // GAME_ZYMOTIC
 // COMMANDLINEOPTION: Game: -zymotic runs the singleplayer game Zymotic
 { "zymotic",           "-zymotic",             "Zymotic",                              "basezym",              NULL,                   "zymotic",              "zymotic" },
-// GAME_FNIGGIUM
-// COMMANDLINEOPTION: Game: -fniggium runs the post apocalyptic melee RPG Fniggium
-{ "fniggium",          "-fniggium",    "Fniggium",                             "data",         NULL,                   "fniggium",             "fniggium" },
 // GAME_SETHERAL
 // COMMANDLINEOPTION: Game: -setheral runs the multiplayer game Setheral
 { "setheral",          "-setheral",    "Setheral",                             "data",         NULL,                   "setheral",             "setheral" },
index e452e2e..ac7e6cb 100644 (file)
--- a/common.h
+++ b/common.h
@@ -246,7 +246,6 @@ typedef enum gamemode_e
        GAME_TEU,
        GAME_BATTLEMECH,
        GAME_ZYMOTIC,
-       GAME_FNIGGIUM,
        GAME_SETHERAL,
        GAME_SOM,
        GAME_TENEBRAE, // full of evil hackery
diff --git a/jpeg.c b/jpeg.c
index 7e503d3..ebdab17 100644 (file)
--- a/jpeg.c
+++ b/jpeg.c
@@ -534,8 +534,10 @@ unsigned char* JPEG_LoadImage (const unsigned char *f, int filesize, int matchwi
        scanline = (unsigned char *)Mem_Alloc(tempmempool, image_width * cinfo.output_components);
        if (!image_rgba || !scanline)
        {
-               if (!image_rgba)
+               if (image_rgba)
                        Mem_Free (image_rgba);
+               if (scanline)
+                       Mem_Free (scanline);
 
                Con_Printf("JPEG_LoadImage: not enough memory for %i by %i image\n", image_width, image_height);
                qjpeg_finish_decompress (&cinfo);