Module Name: src Committed By: bouyer Date: Fri Feb 14 23:21:25 UTC 2014
Modified Files: src/sys/kern [netbsd-6-1]: exec_elf.c Log Message: Pull up following revision(s) (requested by maxv in ticket #1028): sys/kern/exec_elf.c: revision 1.55 Fix memory leak. ok christos@ agc@ To generate a diff of this commit: cvs rdiff -u -r1.37.2.1 -r1.37.2.1.6.1 src/sys/kern/exec_elf.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/kern/exec_elf.c diff -u src/sys/kern/exec_elf.c:1.37.2.1 src/sys/kern/exec_elf.c:1.37.2.1.6.1 --- src/sys/kern/exec_elf.c:1.37.2.1 Thu Apr 12 17:05:36 2012 +++ src/sys/kern/exec_elf.c Fri Feb 14 23:21:25 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: exec_elf.c,v 1.37.2.1 2012/04/12 17:05:36 riz Exp $ */ +/* $NetBSD: exec_elf.c,v 1.37.2.1.6.1 2014/02/14 23:21:25 bouyer Exp $ */ /*- * Copyright (c) 1994, 2000, 2005 The NetBSD Foundation, Inc. @@ -57,7 +57,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.37.2.1 2012/04/12 17:05:36 riz Exp $"); +__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.37.2.1.6.1 2014/02/14 23:21:25 bouyer Exp $"); #ifdef _KERNEL_OPT #include "opt_pax.h" @@ -820,6 +820,7 @@ exec_elf_makecmds(struct lwp *l, struct if ((error = elf_load_file(l, epp, interp, &epp->ep_vmcmds, &interp_offset, ap, &pos)) != 0) { + kmem_free(ap, sizeof(*ap)); goto bad; } ap->arg_interp = epp->ep_vmcmds.evs_cmds[j].ev_addr;