From 630048fa99d7c95286d39209add9e54c6bda0cf9 Mon Sep 17 00:00:00 2001 From: zicodxx Date: Wed, 13 Apr 2011 21:11:20 +0200 Subject: [PATCH] Fixing unfreed buffer when credits_show() was called but there was nothing to show me --- CHANGELOG.txt | 1 + main/credits.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 472124e04..26ff1726d 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -4,6 +4,7 @@ D1X-Rebirth Changelog -------- main/net_udp.c, main/net_udp.h: Improved security for UDP protocol: Add checks for correct packet size and - if possible - valid sender address (valid player) and making sure Clients only accept packets meant for Clients and Hosts only accept packets meant for Hosts main/fvi.c, main/physics.c: Bit more safeguarding in find_plane_line_intersection() and as a result less agressive but more beautiful back-bumping on illegal wall interesections; Scaling of movement from PhysTime to FrameTime now done with vector math functions +main/credits.c: Fixing unfreed buffer when credits_show() was called but there was nothing to show me 20110412 -------- diff --git a/main/credits.c b/main/credits.c index ef0e4ce76..0b4f52c53 100644 --- a/main/credits.c +++ b/main/credits.c @@ -210,7 +210,10 @@ void credits_show(char *credits_filename) char nfile[32]; if (credits_filename) + { + d_free(cr); return; //ok to not find special filename + } tempp = strchr(filename, '.'); *tempp = '\0'; @@ -227,6 +230,7 @@ void credits_show(char *credits_filename) pcx_error = pcx_read_bitmap(STARS_BACKGROUND,&cr->backdrop, BM_LINEAR,backdrop_palette); if (pcx_error != PCX_ERROR_NONE) { cfclose(cr->file); + d_free(cr); return; }