mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 10:22:17 +00:00
uf2: Fix a small memory leak when parsing files
Fixes https://oss-fuzz.com/testcase-detail/4617823934087168
This commit is contained in:
parent
bdfe66a16e
commit
6fd7a62efe
@ -239,6 +239,7 @@ fu_uf2_firmware_parse(FuFirmware *firmware,
|
|||||||
{
|
{
|
||||||
FuUf2Firmware *self = FU_UF2_FIRMWARE(firmware);
|
FuUf2Firmware *self = FU_UF2_FIRMWARE(firmware);
|
||||||
g_autoptr(GByteArray) tmp = g_byte_array_new();
|
g_autoptr(GByteArray) tmp = g_byte_array_new();
|
||||||
|
g_autoptr(GBytes) blob = NULL;
|
||||||
g_autoptr(GPtrArray) chunks = NULL;
|
g_autoptr(GPtrArray) chunks = NULL;
|
||||||
|
|
||||||
/* read in fixed sized chunks */
|
/* read in fixed sized chunks */
|
||||||
@ -250,7 +251,8 @@ fu_uf2_firmware_parse(FuFirmware *firmware,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* success */
|
/* success */
|
||||||
fu_firmware_set_bytes(firmware, g_byte_array_free_to_bytes(g_steal_pointer(&tmp)));
|
blob = g_byte_array_free_to_bytes(g_steal_pointer(&tmp));
|
||||||
|
fu_firmware_set_bytes(firmware, blob);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user