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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to