mirror of
https://github.com/openbsd/src.git
synced 2024-12-22 16:42:56 -08:00
avoid what would be a leak if reused elsewhere but isn't in this
case as the memory is freed on exit. ok krw@ kettenis@
This commit is contained in:
parent
048d2d848d
commit
48e4789bfe
@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: pcidump.c,v 1.31 2012/05/16 13:01:50 jsg Exp $ */
|
||||
/* $OpenBSD: pcidump.c,v 1.32 2012/07/03 13:09:25 jsg Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2006, 2007 David Gwynne <loki@animata.net>
|
||||
@ -761,8 +761,12 @@ dump_vga_bios(void)
|
||||
if (pread(fd, bios, VGA_BIOS_LEN, VGA_BIOS_ADDR) == -1)
|
||||
err(1, "%s", _PATH_MEM);
|
||||
|
||||
if (write(romfd, bios, VGA_BIOS_LEN) == -1)
|
||||
if (write(romfd, bios, VGA_BIOS_LEN) == -1) {
|
||||
free(bios);
|
||||
return (errno);
|
||||
}
|
||||
|
||||
free(bios);
|
||||
|
||||
return (0);
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user