GCS_MAVLink: check for alloc failure of ObjectBuffer

This commit is contained in:
Andrew Tridgell 2023-01-02 08:33:22 +11:00 committed by Randy Mackay
parent 6e6df75b2a
commit da4a9297a0
1 changed files with 1 additions and 1 deletions

View File

@ -44,7 +44,7 @@ bool GCS_MAVLINK::ftp_init(void) {
}
ftp.requests = new ObjectBuffer<pending_ftp>(5);
if (ftp.requests == nullptr) {
if (ftp.requests == nullptr || ftp.requests->get_size() == 0) {
goto failed;
}