microbit-sam / microbit-dal

http://lancaster-university.github.io/microbit-docs
Other
0 stars 0 forks source link

MicroBitBLEManager::restartInBLEMode() uses the wrong size for RebootModeValue #11

Open martinwork opened 6 years ago

martinwork commented 6 years ago

On branch "code-review"...

RebootMode is deleted when it is NULL. When it's non-NULL, RebootMode leaks, though this doesn't matter much as the next line is a reset.

sizeof(RebootMode) should be sizeof(RebootModeValue).

martinwork commented 6 years ago

Just realised microbit_free checks for a NULL pointer, so in normal circumstances it won't crash, but deleting a NULL pointer still seems wrong!

And sizeof(RebootMode) should be sizeof(RebootModeValue).