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:
parent
a67fa10338
commit
18be4a71df
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=21967
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user