Fix a memory leak on error path, spottend by cppcheck.

While at it cleanup a static vs const misuse.
This commit is contained in:
riccardom 2010-02-02 16:46:44 +00:00
parent 8875c7d302
commit 9ade0bd991
1 changed files with 2 additions and 2 deletions

View File

@ -659,10 +659,10 @@ int NDS_WritePNG(const char *fname)
if(!(pp=fopen(fname, "wb")))
{
return 0;
goto PNGerr;
}
{
static uint8 header[8]={137,80,78,71,13,10,26,10};
const uint8 header[8]={137,80,78,71,13,10,26,10};
if(fwrite(header,8,1,pp)!=1)
goto PNGerr;
}