On malloc failure, be sure to close the include file that triggered

it.

CID: 1007775
Sponsored by: Netflix
This commit is contained in:
Warner Losh 2018-01-23 18:01:32 +00:00
parent 74ecc44117
commit 4baa8d7ebd
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=328290

View file

@ -250,6 +250,7 @@ include(const char *filename)
snprintf(command_errbuf, sizeof(command_errbuf),
"file '%s' line %d: memory allocation failure - aborting",
filename, line);
close(fd);
return (CMD_ERROR);
}
strcpy(sp->text, cp);