summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-08-15 20:16:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-08-15 20:16:35 +0000
commitad12df089efca37695d2c12d022426e944e7af4f (patch)
tree15b03c593a8497280c7a849f54f95ff9af1e1101
parenteb305ae061e907240c6eb8168b79d51f025e5d07 (diff)
fix realloc
-rw-r--r--sbin/ccdconfig/ccdconfig.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c
index 6986d8089a4..3e842304cfb 100644
--- a/sbin/ccdconfig/ccdconfig.c
+++ b/sbin/ccdconfig/ccdconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccdconfig.c,v 1.11 1998/07/08 22:24:54 deraadt Exp $ */
+/* $OpenBSD: ccdconfig.c,v 1.12 1998/08/15 20:16:34 deraadt Exp $ */
/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */
/*-
@@ -328,6 +328,7 @@ do_all(action)
char *cp, **argv;
int argc, rval = 0;
gid_t egid;
+ char **nargv;
egid = getegid();
setegid(getgid());
@@ -351,11 +352,12 @@ do_all(action)
for (cp = line; (cp = strtok(cp, " \t")) != NULL; cp = NULL) {
if (*cp == '#')
break;
- if ((argv = realloc(argv,
+ if ((nargv = realloc(argv,
sizeof(char *) * ++argc)) == NULL) {
warnx("no memory to configure ccds");
return (1);
}
+ argv = nargv;
argv[argc - 1] = cp;
/*
* If our action is to unconfigure all, then pass