AP_Logger: fix memory leak when finding last log

This commit is contained in:
Peter Barker 2021-04-15 18:15:16 +10:00 committed by Andrew Tridgell
parent ec11bf1146
commit 13dc5bee25

View File

@ -503,6 +503,7 @@ uint16_t AP_Logger_File::find_last_log()
}
EXPECT_DELAY_MS(3000);
FileData *fd = AP::FS().load_file(fname);
free(fname);
if (fd != nullptr) {
ret = strtol((const char *)fd->data, NULL, 10);
delete fd;