aboutsummaryrefslogtreecommitdiff
path: root/stand
diff options
context:
space:
mode:
authorWarner Losh <imp@FreeBSD.org>2018-01-23 18:01:32 +0000
committerWarner Losh <imp@FreeBSD.org>2018-01-23 18:01:32 +0000
commit4baa8d7ebd9e610ca2d5bf1372e9881e105cc35e (patch)
tree39a671a09d24b23fd3b07b7339ca302434116eec /stand
parent74ecc44117a0163196a2b6ae88a8f6c55034f975 (diff)
downloadsrc-4baa8d7ebd9e610ca2d5bf1372e9881e105cc35e.tar.gz
src-4baa8d7ebd9e610ca2d5bf1372e9881e105cc35e.zip
On malloc failure, be sure to close the include file that triggered
it. CID: 1007775 Sponsored by: Netflix
Notes
Notes: svn path=/head/; revision=328290
Diffstat (limited to 'stand')
-rw-r--r--stand/common/interp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/stand/common/interp.c b/stand/common/interp.c
index 6b1b8bbf0db8..7dbf931f8c86 100644
--- a/stand/common/interp.c
+++ b/stand/common/interp.c
@@ -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);