diff options
| author | christos <christos@NetBSD.org> | 2006-03-17 23:29:07 +0000 |
|---|---|---|
| committer | christos <christos@NetBSD.org> | 2006-03-17 23:29:07 +0000 |
| commit | 5a57baa413c15b5cb57d69bf87b9cb3a38bdbc9b (patch) | |
| tree | 952a829115d724b4b32f495c84f2d5a7af8a8763 /sys/kern/exec_script.c | |
| parent | ee3808b74f5b38cc291cfd124ba80fd4d86c3d55 (diff) | |
don't use MALLOC with a non-constant size; use malloc instead.
Diffstat (limited to 'sys/kern/exec_script.c')
| -rw-r--r-- | sys/kern/exec_script.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/exec_script.c b/sys/kern/exec_script.c index 3a7ceaa9d88..93f23d98396 100644 --- a/sys/kern/exec_script.c +++ b/sys/kern/exec_script.c @@ -1,4 +1,4 @@ -/* $NetBSD: exec_script.c,v 1.45 2005/12/11 12:24:29 christos Exp $ */ +/* $NetBSD: exec_script.c,v 1.46 2006/03/17 23:29:09 christos Exp $ */ /* * Copyright (c) 1993, 1994, 1996 Christopher G. Demetriou @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.45 2005/12/11 12:24:29 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: exec_script.c,v 1.46 2006/03/17 23:29:09 christos Exp $"); #if defined(SETUIDSCRIPTS) && !defined(FDSCRIPTS) #define FDSCRIPTS /* Need this for safe set-id scripts. */ @@ -223,10 +223,10 @@ check_shell: /* and set up the fake args list, for later */ MALLOC(shellargp, char **, 4 * sizeof(char *), M_EXEC, M_WAITOK); tmpsap = shellargp; - MALLOC(*tmpsap, char *, shellnamelen + 1, M_EXEC, M_WAITOK); + *tmpsap = malloc(shellnamelen + 1, M_EXEC, M_WAITOK); strlcpy(*tmpsap++, shellname, shellnamelen + 1); if (shellarg != NULL) { - MALLOC(*tmpsap, char *, shellarglen + 1, M_EXEC, M_WAITOK); + *tmpsap = malloc(shellarglen + 1, M_EXEC, M_WAITOK); strlcpy(*tmpsap++, shellarg, shellarglen + 1); } MALLOC(*tmpsap, char *, MAXPATHLEN, M_EXEC, M_WAITOK); |
