1
0
Fork 0
mirror of https://gitlab.com/sortix/sortix.git synced 2023-02-13 20:55:38 -05:00

BGA: Fix possible memory leak.

This commit is contained in:
Jonas 'Sortie' Termansen 2012-12-05 01:09:05 +01:00
parent 4d37197472
commit 3116161f5d

View file

@ -303,11 +303,17 @@ bool BGADriver::SwitchMode(const char* mode)
{
bool result = false;
char* modeclone = String::Clone(mode);
if ( !modeclone )
return NULL;
char* xstr = NULL;
char* ystr = NULL;
char* bppstr = NULL;
if ( !ReadParamString(mode, "width", &xstr, "height", &ystr,
"bpp", &bppstr, "STOP") ) { return false; }
"bpp", &bppstr, "STOP") )
{
delete[] modeclone;
return false;
}
uint16_t xres = xstr ? atoi(xstr) : 0;
uint16_t yres = ystr ? atoi(ystr) : 0;
uint16_t bpp = bppstr ? atoi(bppstr) : 32;