From 2d6f24a3f2d1f78824d28f9256c516eb48715c90 Mon Sep 17 00:00:00 2001 From: helixhorned Date: Sat, 18 Feb 2012 22:15:19 +0000 Subject: [PATCH] Fix a potential free() of stack memory in screenshot code. Ouch! git-svn-id: https://svn.eduke32.com/eduke32@2363 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/src/engine.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/polymer/eduke32/build/src/engine.c b/polymer/eduke32/build/src/engine.c index 3db2f119c..a3cca1eb3 100644 --- a/polymer/eduke32/build/src/engine.c +++ b/polymer/eduke32/build/src/engine.c @@ -15609,10 +15609,7 @@ static int32_t screencapture_common1(char *fn, const char *ext, BFILE** filptr) *filptr = Bfopen(fn,"wb"); if (*filptr == NULL) - { - Bfree(fn); return -1; - } return 0; } @@ -15774,7 +15771,10 @@ static int32_t screencapture_tga(const char *filename, char inverseit) i = screencapture_common1(fn, "tga", &fil); if (i) + { + Bfree(fn); return i; + } # ifdef USE_OPENGL if (rendmode >= 3 && qsetmode == 200)