aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1997-01-24 00:07:03 +0000
committerJohn Polstra <jdp@FreeBSD.org>1997-01-24 00:07:03 +0000
commit18be4a71df49644a31da632571ca5a625785971c (patch)
tree38821b8d83fcac8ac328f114bd6fb77b1c3c2534
parenta67fa10338ca70d5645855c20de08f12fd200971 (diff)
downloadsrc-18be4a71df49644a31da632571ca5a625785971c.tar.gz
src-18be4a71df49644a31da632571ca5a625785971c.zip
Use xmalloc instead of malloc in two places, so that out-of-memory
conditions will be detected. Submitted by: Philippe Charnier <charnier@xp11.frmug.org>
Notes
Notes: svn path=/head/; revision=21967
-rw-r--r--gnu/usr.bin/ld/ld.c2
-rw-r--r--gnu/usr.bin/ld/support.c2
-rw-r--r--libexec/rtld-aout/support.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/gnu/usr.bin/ld/ld.c b/gnu/usr.bin/ld/ld.c
index 56e4c9c01840..900eb6892695 100644
--- a/gnu/usr.bin/ld/ld.c
+++ b/gnu/usr.bin/ld/ld.c
@@ -704,7 +704,7 @@ decode_option(swt, arg)
return;
case 'O':
- output_filename = malloc(strlen(arg)+5);
+ output_filename = xmalloc(strlen(arg)+5);
strcpy(output_filename, arg);
strcat(output_filename, ".tmp");
real_output_filename = arg;
diff --git a/gnu/usr.bin/ld/support.c b/gnu/usr.bin/ld/support.c
index d952330ee2ce..71a84ffa1299 100644
--- a/gnu/usr.bin/ld/support.c
+++ b/gnu/usr.bin/ld/support.c
@@ -49,7 +49,7 @@ concat(s1, s2, s3)
len += strlen(s2);
if (s3)
len += strlen(s3);
- s = malloc(len);
+ s = xmalloc(len);
s[0] = '\0';
if (s1)
strcat(s, s1);
diff --git a/libexec/rtld-aout/support.c b/libexec/rtld-aout/support.c
index d952330ee2ce..71a84ffa1299 100644
--- a/libexec/rtld-aout/support.c
+++ b/libexec/rtld-aout/support.c
@@ -49,7 +49,7 @@ concat(s1, s2, s3)
len += strlen(s2);
if (s3)
len += strlen(s3);
- s = malloc(len);
+ s = xmalloc(len);
s[0] = '\0';
if (s1)
strcat(s, s1);