Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 May 2016 09:49:52 +0000 (UTC)
From:      Garrett Cooper <ngie@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org
Subject:   svn commit: r299649 - stable/10/lib/libkvm
Message-ID:  <201605130949.u4D9nqNR088427@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ngie
Date: Fri May 13 09:49:52 2016
New Revision: 299649
URL: https://svnweb.freebsd.org/changeset/base/299649

Log:
  MFC r298842:
  
  Don't leak PML4 in _amd64_initvtop(..) if kvm_read2(..) fails
  
  CID: 1341474

Modified:
  stable/10/lib/libkvm/kvm_amd64.c
Directory Properties:
  stable/10/   (props changed)

Modified: stable/10/lib/libkvm/kvm_amd64.c
==============================================================================
--- stable/10/lib/libkvm/kvm_amd64.c	Fri May 13 09:46:23 2016	(r299648)
+++ stable/10/lib/libkvm/kvm_amd64.c	Fri May 13 09:49:52 2016	(r299649)
@@ -200,6 +200,7 @@ _kvm_initvtop(kvm_t *kd)
 	PML4 = _kvm_malloc(kd, PAGE_SIZE);
 	if (kvm_read(kd, pa, PML4, PAGE_SIZE) != PAGE_SIZE) {
 		_kvm_err(kd, kd->program, "cannot read KPML4phys");
+		free(PML4);
 		return (-1);
 	}
 	kd->vmst->PML4 = PML4;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201605130949.u4D9nqNR088427>