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>
This commit is contained in:
John Polstra 1997-01-24 00:07:03 +00:00
parent a67fa10338
commit 18be4a71df
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21967
3 changed files with 3 additions and 3 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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);