diff options
author | ngie <ngie@FreeBSD.org> | 2016-04-30 09:32:19 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2016-04-30 09:32:19 +0000 |
commit | 7dabfb1c6fb92ed86899f74e3076316e2002bc0a (patch) | |
tree | c66c3bb5f6afcc72e900b74e245cd67ae97b80b4 /lib | |
parent | e2c5974fd3000f928eee7e749678e42918b9a395 (diff) | |
download | FreeBSD-src-7dabfb1c6fb92ed86899f74e3076316e2002bc0a.zip FreeBSD-src-7dabfb1c6fb92ed86899f74e3076316e2002bc0a.tar.gz |
Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails
MFC after: 1 week
Reported by: Coverity
CID: 1341474
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libkvm/kvm_amd64.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libkvm/kvm_amd64.c b/lib/libkvm/kvm_amd64.c index 57a8728..32cef2f 100644 --- a/lib/libkvm/kvm_amd64.c +++ b/lib/libkvm/kvm_amd64.c @@ -159,6 +159,7 @@ _amd64_initvtop(kvm_t *kd) } if (kvm_read2(kd, pa, PML4, AMD64_PAGE_SIZE) != AMD64_PAGE_SIZE) { _kvm_err(kd, kd->program, "cannot read KPML4phys"); + free(PML4); return (-1); } kd->vmst->PML4 = PML4; |