fix memory bugs in replay and bl_update

This commit is contained in:
Hyungsub
2021-08-18 07:45:51 +02:00
committed by GitHub
parent 810dbbd25b
commit d089d4a6a4
2 changed files with 6 additions and 1 deletions
+2 -1
View File
@@ -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");