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:
parent
4d37197472
commit
3116161f5d
1 changed files with 7 additions and 1 deletions
|
@ -303,11 +303,17 @@ bool BGADriver::SwitchMode(const char* mode)
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
char* modeclone = String::Clone(mode);
|
char* modeclone = String::Clone(mode);
|
||||||
|
if ( !modeclone )
|
||||||
|
return NULL;
|
||||||
char* xstr = NULL;
|
char* xstr = NULL;
|
||||||
char* ystr = NULL;
|
char* ystr = NULL;
|
||||||
char* bppstr = NULL;
|
char* bppstr = NULL;
|
||||||
if ( !ReadParamString(mode, "width", &xstr, "height", &ystr,
|
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 xres = xstr ? atoi(xstr) : 0;
|
||||||
uint16_t yres = ystr ? atoi(ystr) : 0;
|
uint16_t yres = ystr ? atoi(ystr) : 0;
|
||||||
uint16_t bpp = bppstr ? atoi(bppstr) : 32;
|
uint16_t bpp = bppstr ? atoi(bppstr) : 32;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue