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
This commit is contained in:
helixhorned 2012-02-18 22:15:19 +00:00
parent 165d291a48
commit 2d6f24a3f2

View file

@ -15609,10 +15609,7 @@ static int32_t screencapture_common1(char *fn, const char *ext, BFILE** filptr)
*filptr = Bfopen(fn,"wb"); *filptr = Bfopen(fn,"wb");
if (*filptr == NULL) if (*filptr == NULL)
{
Bfree(fn);
return -1; return -1;
}
return 0; return 0;
} }
@ -15774,7 +15771,10 @@ static int32_t screencapture_tga(const char *filename, char inverseit)
i = screencapture_common1(fn, "tga", &fil); i = screencapture_common1(fn, "tga", &fil);
if (i) if (i)
{
Bfree(fn);
return i; return i;
}
# ifdef USE_OPENGL # ifdef USE_OPENGL
if (rendmode >= 3 && qsetmode == 200) if (rendmode >= 3 && qsetmode == 200)