summaryrefslogtreecommitdiff
path: root/usr.sbin/config
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-09-26 17:00:28 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-09-26 17:00:28 +0000
commit456be62e692ee84728c7a7283e4a5afb392772a6 (patch)
treeb5d46f403997bf9210643017165a5b4fa2357266 /usr.sbin/config
parent3eb05be2c30c7160386a503f026620177a12a967 (diff)
use emalloc
Diffstat (limited to 'usr.sbin/config')
-rw-r--r--usr.sbin/config/exec_aout.c9
-rw-r--r--usr.sbin/config/exec_ecoff.c11
-rw-r--r--usr.sbin/config/exec_elf.c7
3 files changed, 15 insertions, 12 deletions
diff --git a/usr.sbin/config/exec_aout.c b/usr.sbin/config/exec_aout.c
index 8edf108f579..42bc682741d 100644
--- a/usr.sbin/config/exec_aout.c
+++ b/usr.sbin/config/exec_aout.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_aout.c,v 1.7 2003/06/28 04:55:07 deraadt Exp $ */
+/* $OpenBSD: exec_aout.c,v 1.8 2003/09/26 17:00:27 deraadt Exp $ */
/*
* Copyright (c) 1999 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: exec_aout.c,v 1.7 2003/06/28 04:55:07 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: exec_aout.c,v 1.8 2003/09/26 17:00:27 deraadt Exp $";
#endif
#include <err.h>
@@ -38,6 +38,7 @@ static char rcsid[] = "$OpenBSD: exec_aout.c,v 1.7 2003/06/28 04:55:07 deraadt E
#include <sys/exec.h>
#include <sys/types.h>
+#include "config.h"
#include "ukc.h"
caddr_t aout_p, aout_r;
@@ -140,7 +141,7 @@ aout_loadkernel(char *file)
aout_psz = (int)(aout_ex.a_text + N_TXTOFF(aout_ex) +
aout_ex.a_data);
- aout_p = malloc(aout_psz);
+ aout_p = emalloc(aout_psz);
if (read(fd, aout_p, aout_psz) != aout_psz)
errx(1, "can't read a.out text and data");
@@ -151,7 +152,7 @@ aout_loadkernel(char *file)
aout_rsz = (int)(end - cur);
- aout_r = malloc(aout_rsz);
+ aout_r = emalloc(aout_rsz);
if (read(fd, aout_r, aout_rsz) != aout_rsz)
errx(1, "can't read rest of file %s", file);
diff --git a/usr.sbin/config/exec_ecoff.c b/usr.sbin/config/exec_ecoff.c
index 7e3802c5c37..acd0ebfdd26 100644
--- a/usr.sbin/config/exec_ecoff.c
+++ b/usr.sbin/config/exec_ecoff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_ecoff.c,v 1.8 2003/06/28 04:55:07 deraadt Exp $ */
+/* $OpenBSD: exec_ecoff.c,v 1.9 2003/09/26 17:00:27 deraadt Exp $ */
/*
* Copyright (c) 1999 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: exec_ecoff.c,v 1.8 2003/06/28 04:55:07 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: exec_ecoff.c,v 1.9 2003/09/26 17:00:27 deraadt Exp $";
#endif
#include <err.h>
@@ -39,6 +39,7 @@ static char rcsid[] = "$OpenBSD: exec_ecoff.c,v 1.8 2003/06/28 04:55:07 deraadt
#include <sys/exec_ecoff.h>
#include <sys/types.h>
+#include "config.h"
#include "ukc.h"
caddr_t ecoff_p, ecoff_r, ecoff_b;
@@ -104,9 +105,9 @@ ecoff_loadkernel(char *file)
beg = lseek(fd, ECOFF_TXTOFF(&ecoff_ex), SEEK_SET);
ecoff_bsz = (int)beg;
- ecoff_b = malloc(ecoff_bsz);
+ ecoff_b = emalloc(ecoff_bsz);
- ecoff_p = malloc(ecoff_psz);
+ ecoff_p = emalloc(ecoff_psz);
if (read(fd, ecoff_p, ecoff_psz) != ecoff_psz)
errx(1, "can't read ecoff text and data");
@@ -120,7 +121,7 @@ ecoff_loadkernel(char *file)
ecoff_rsz = (int)(end - cur);
- ecoff_r = malloc(ecoff_rsz);
+ ecoff_r = emalloc(ecoff_rsz);
if (read(fd, ecoff_r, ecoff_rsz) != ecoff_rsz)
errx(1, "can't read rest of file %s", file);
diff --git a/usr.sbin/config/exec_elf.c b/usr.sbin/config/exec_elf.c
index 54aacdd94e6..33b27997615 100644
--- a/usr.sbin/config/exec_elf.c
+++ b/usr.sbin/config/exec_elf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_elf.c,v 1.8 2003/06/28 04:55:07 deraadt Exp $ */
+/* $OpenBSD: exec_elf.c,v 1.9 2003/09/26 17:00:27 deraadt Exp $ */
/*
* Copyright (c) 1999 Mats O Jansson. All rights reserved.
@@ -25,7 +25,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: exec_elf.c,v 1.8 2003/06/28 04:55:07 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: exec_elf.c,v 1.9 2003/09/26 17:00:27 deraadt Exp $";
#endif
#include <err.h>
@@ -40,6 +40,7 @@ static char rcsid[] = "$OpenBSD: exec_elf.c,v 1.8 2003/06/28 04:55:07 deraadt Ex
#include <sys/types.h>
#include "ukc.h"
+#include "config.h"
caddr_t ptr, rest, pre;
Elf_Ehdr elf_ex;
@@ -137,7 +138,7 @@ elf_loadkernel(char *file)
elf_size = lseek(fd, 0L, SEEK_END);
(void)lseek(fd, 0L, SEEK_SET);
- elf_total = malloc(elf_size);
+ elf_total = emalloc(elf_size);
if (read(fd, elf_total, elf_size) != elf_size)
errx(1, "can't read elf kernel");