fix memory leak and otherwise stabilize code in emufile

This commit is contained in:
zeromus 2009-08-29 23:48:29 +00:00
parent 0a07f61db0
commit 60276cdf2e
1 changed files with 2 additions and 5 deletions

View File

@ -107,12 +107,9 @@ public:
int amt = vsnprintf(0,0,format,argptr);
char* tempbuf = new char[amt+1];
vsprintf(tempbuf,format,argptr);
memcpy((char*)buf()+pos,tempbuf,amt);
pos += amt;
len = std::max(pos,len);
fwrite(tempbuf,amt);
delete[] tempbuf;
va_end(argptr);
return amt;
};