mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-23 19:53:34 +08:00
fix memory bugs in replay and bl_update
This commit is contained in:
@@ -142,7 +142,6 @@ bl_update_main(int argc, char *argv[])
|
||||
#endif
|
||||
|
||||
uint8_t *buf = malloc(image_size);
|
||||
memset(buf, 0xff, image_size);
|
||||
|
||||
if (buf == NULL)
|
||||
{
|
||||
@@ -151,6 +150,8 @@ bl_update_main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
memset(buf, 0xff, image_size);
|
||||
|
||||
if (read(fd, buf, file_size) != file_size)
|
||||
{
|
||||
PX4_ERR("firmware read error");
|
||||
|
||||
Reference in New Issue
Block a user