Module Name: src
Committed By: maxv
Date: Fri Feb 14 07:30:07 UTC 2014
Modified Files:
src/sys/kern: exec_elf.c
Log Message:
Fix memory leak.
ok christos@ agc@
To generate a diff of this commit:
cvs rdiff -u -r1.54 -r1.55 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.54 src/sys/kern/exec_elf.c:1.55
--- src/sys/kern/exec_elf.c:1.54 Sat Jan 25 19:44:11 2014
+++ src/sys/kern/exec_elf.c Fri Feb 14 07:30:07 2014
@@ -1,4 +1,4 @@
-/* $NetBSD: exec_elf.c,v 1.54 2014/01/25 19:44:11 christos Exp $ */
+/* $NetBSD: exec_elf.c,v 1.55 2014/02/14 07:30:07 maxv 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.54 2014/01/25 19:44:11 christos Exp $");
+__KERNEL_RCSID(1, "$NetBSD: exec_elf.c,v 1.55 2014/02/14 07:30:07 maxv Exp $");
#ifdef _KERNEL_OPT
#include "opt_pax.h"
@@ -823,6 +823,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;