On Wed, Nov 5, 2025 at 7:22 AM Heinrich Schuchardt <[email protected]> wrote: > > In case of an error always free variable name. > > Signed-off-by: Heinrich Schuchardt <[email protected]> > --- > lib/efi_driver/efi_block_device.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/efi_driver/efi_block_device.c > b/lib/efi_driver/efi_block_device.c > index c389b1920a8..7ce6a45a5f3 100644 > --- a/lib/efi_driver/efi_block_device.c > +++ b/lib/efi_driver/efi_block_device.c > @@ -146,7 +146,6 @@ efi_bl_create_block_device(efi_handle_t handle, void > *interface) > devnum, io->media->block_size, > (lbaint_t)io->media->last_block, &bdev)) { > ret = EFI_OUT_OF_RESOURCES; > - free(name); > goto err; > } > > @@ -171,6 +170,7 @@ err: > efi_unlink_dev(handle); > if (bdev) > device_unbind(bdev); > + free(name); > > return ret; > }
free() should be inserted right after the blk_create_devicef() call as the success path also leaks the 'name'. Regards, Bin

