From 16d5cd91ded24a05c1b42ad0587bd5fa92f5a6a0 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Wed, 15 Apr 2020 10:56:49 -0400 Subject: [PATCH] emul: don't segfault on quit when there is no blkfs --- emul/forth/forth.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/emul/forth/forth.c b/emul/forth/forth.c index 067618a..e177006 100644 --- a/emul/forth/forth.c +++ b/emul/forth/forth.c @@ -118,7 +118,9 @@ int main(int argc, char *argv[]) tcsetattr(0, TCSAFLUSH, &termInfo); emul_printdebug(); } - fclose(blkfp); + if (blkfp != NULL) { + fclose(blkfp); + } fclose(fp); return retcode; }