artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
697c3ac
)
Fix a memory leak in an error path.
author
jsg
<jsg@openbsd.org>
Mon, 27 Jun 2016 13:06:41 +0000
(13:06 +0000)
committer
jsg
<jsg@openbsd.org>
Mon, 27 Jun 2016 13:06:41 +0000
(13:06 +0000)
ok mikeb@
sys/dev/pv/hyperv.c
patch
|
blob
|
history
diff --git
a/sys/dev/pv/hyperv.c
b/sys/dev/pv/hyperv.c
index
16d2d18
..
d99d9f8
100644
(file)
--- a/
sys/dev/pv/hyperv.c
+++ b/
sys/dev/pv/hyperv.c
@@
-1487,8
+1487,10
@@
hv_handle_alloc(struct hv_channel *ch, void *buffer, uint32_t buflen,
/* Prepare array of frame addresses */
if ((frames = mallocarray(total, sizeof(*frames), M_DEVBUF, M_ZERO |
- waitok)) == NULL)
+ waitok)) == NULL) {
+ free(msg, M_DEVBUF, sizeof(*msg));
return (ENOMEM);
+ }
for (i = 0; i < total; i++) {
if (!pmap_extract(pmap_kernel(), (vaddr_t)buffer +
PAGE_SIZE * i, &pa)) {