Date: Fri, 10 Jun 2016 14:45:20 +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: r301791 - stable/10/sys/kern Message-ID: <201606101445.u5AEjKfm048253@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ngie Date: Fri Jun 10 14:45:20 2016 New Revision: 301791 URL: https://svnweb.freebsd.org/changeset/base/301791 Log: MFC r299494: r299494 (by cem): subr_vmem: Fix double-free in error case of vmem_create If vmem_init() fails, 'vm' is already destroyed and freed. Don't free it again. CID: 1042110 Modified: stable/10/sys/kern/subr_vmem.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/kern/subr_vmem.c ============================================================================== --- stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:42:36 2016 (r301790) +++ stable/10/sys/kern/subr_vmem.c Fri Jun 10 14:45:20 2016 (r301791) @@ -1046,10 +1046,8 @@ vmem_create(const char *name, vmem_addr_ if (vm == NULL) return (NULL); if (vmem_init(vm, name, base, size, quantum, qcache_max, - flags) == NULL) { - free(vm, M_VMEM); + flags) == NULL) return (NULL); - } return (vm); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606101445.u5AEjKfm048253>