diff options
author | 2012-07-03 13:09:25 +0000 | |
---|---|---|
committer | 2012-07-03 13:09:25 +0000 | |
commit | 48e4789bfea471f3207878257d0089f7e33fc1e8 (patch) | |
tree | c57f36acc89c985e000039df88d6d56ffb766382 | |
parent | BCM5754 should stay, noticed by brad (diff) | |
download | wireguard-openbsd-48e4789bfea471f3207878257d0089f7e33fc1e8.tar.xz wireguard-openbsd-48e4789bfea471f3207878257d0089f7e33fc1e8.zip |
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@
-rw-r--r-- | usr.sbin/pcidump/pcidump.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/usr.sbin/pcidump/pcidump.c b/usr.sbin/pcidump/pcidump.c index e186d4256ff..0dfd31e722e 100644 --- a/usr.sbin/pcidump/pcidump.c +++ b/usr.sbin/pcidump/pcidump.c @@ -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 |