~paravoid/Demos

4957e09f763d3c03da83221ca223c3d5bdcc501f — paravoid 2 years ago 0008bce
screenshot: add some FreePool()s
1 files changed, 2 insertions(+), 0 deletions(-)

M efigop/screenshot/efiboot.c
M efigop/screenshot/efiboot.c => efigop/screenshot/efiboot.c +2 -0
@@ 1083,6 1083,7 @@ Xscreenshot_efi() {

	BS->LocateHandleBuffer(ByProtocol, &gop_guid, NULL, &nhandles, &handles);
	BS->HandleProtocol(handles[1], &gop_guid, (void **)&second_gop);
	BS->FreePool(handles);
	gopi = second_gop->Mode->Info;
	picsize = gopi->VerticalResolution * gopi->PixelsPerScanLine * 4;
	BS->AllocatePool(EfiLoaderData, picsize, &pixels);


@@ 1091,6 1092,7 @@ Xscreenshot_efi() {

	BS->LocateHandleBuffer(ByProtocol, &fs_guid, NULL, &nhandles, &handles);
	BS->HandleProtocol(handles[0], &fs_guid, (void **)&IOVolume);
	BS->FreePool(handles);
	IOVolume->OpenVolume(IOVolume, &Volume);
	Volume->Open(Volume, &FileHandle, FileName, EFI_FILE_MODE_CREATE | EFI_FILE_MODE_READ | EFI_FILE_MODE_WRITE, 0);
	FileHandle->Write(FileHandle, &picsize, pixels);