Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jan 2018 18:01:32 +0000 (UTC)
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r328290 - head/stand/common
Message-ID:  <201801231801.w0NI1Wxq082158@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: imp
Date: Tue Jan 23 18:01:32 2018
New Revision: 328290
URL: https://svnweb.freebsd.org/changeset/base/328290

Log:
  On malloc failure, be sure to close the include file that triggered
  it.
  
  CID: 1007775
  Sponsored by: Netflix

Modified:
  head/stand/common/interp.c

Modified: head/stand/common/interp.c
==============================================================================
--- head/stand/common/interp.c	Tue Jan 23 18:01:27 2018	(r328289)
+++ head/stand/common/interp.c	Tue Jan 23 18:01:32 2018	(r328290)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201801231801.w0NI1Wxq082158>