mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-13 19:19:03 +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);
|
||||
g_autoptr(GByteArray) tmp = g_byte_array_new();
|
||||
g_autoptr(GBytes) blob = NULL;
|
||||
g_autoptr(GPtrArray) chunks = NULL;
|
||||
|
||||
/* read in fixed sized chunks */
|
||||
@ -250,7 +251,8 @@ fu_uf2_firmware_parse(FuFirmware *firmware,
|
||||
}
|
||||
|
||||
/* 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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user