mirror of
https://github.com/EdgeTX/edgetx.git
synced 2025-07-27 02:05:10 +03:00
Don't leave a big dangling array...
This commit is contained in:
parent
37a0258b19
commit
f6b43ae40f
1 changed files with 3 additions and 0 deletions
|
@ -353,6 +353,7 @@ unsigned int FirmwareInterface::save(QString fileName)
|
|||
|
||||
if (fileType == FILE_TYPE_HEX) {
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate | QIODevice::Text)) { //reading HEX TEXT file
|
||||
free(binflash);
|
||||
return -1;
|
||||
}
|
||||
QTextStream outputStream(&file);
|
||||
|
@ -361,6 +362,7 @@ unsigned int FirmwareInterface::save(QString fileName)
|
|||
}
|
||||
else {
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) { //reading HEX TEXT file
|
||||
free(binflash);
|
||||
return -1;
|
||||
}
|
||||
file.write((char*)binflash, flashSize);
|
||||
|
@ -368,5 +370,6 @@ unsigned int FirmwareInterface::save(QString fileName)
|
|||
|
||||
file.close();
|
||||
|
||||
free(binflash);
|
||||
return flashSize;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue