7bc793b
From 9f597fd10993313262cab400bf3c46ffb3f6fd1e Mon Sep 17 00:00:00 2001
7bc793b
From: Chet Ramey <chet.ramey@case.edu>
7bc793b
Date: Wed, 14 Aug 2019 14:58:44 -0400
7bc793b
Subject: [PATCH] Bash-5.0 patch 9: fix file descriptor leak with zero-length
7bc793b
 history file
7bc793b
7bc793b
---
7bc793b
 lib/readline/histfile.c | 1 +
7bc793b
 patchlevel.h            | 2 +-
7bc793b
 2 files changed, 2 insertions(+), 1 deletion(-)
7bc793b
7bc793b
diff --git a/lib/readline/histfile.c b/lib/readline/histfile.c
7bc793b
index dc64bde1..a8a92aa3 100644
7bc793b
--- a/lib/readline/histfile.c
7bc793b
+++ b/lib/readline/histfile.c
7bc793b
@@ -305,6 +305,7 @@ read_history_range (const char *filename, int from, int to)
7bc793b
   if (file_size == 0)
7bc793b
     {
7bc793b
       free (input);
7bc793b
+      close (file);
7bc793b
       return 0;	/* don't waste time if we don't have to */
7bc793b
     }
7bc793b
 
7bc793b
diff --git a/patchlevel.h b/patchlevel.h
7bc793b
index 16c87404..02f1d606 100644
7bc793b
--- a/patchlevel.h
7bc793b
+++ b/patchlevel.h
7bc793b
@@ -25,6 +25,6 @@
7bc793b
    regexp `^#define[ 	]*PATCHLEVEL', since that's what support/mkversion.sh
7bc793b
    looks for to find the patch level (for the sccs version string). */
7bc793b
 
7bc793b
-#define PATCHLEVEL 8
7bc793b
+#define PATCHLEVEL 9
7bc793b
 
7bc793b
 #endif /* _PATCHLEVEL_H_ */
7bc793b
-- 
7bc793b
2.21.0
7bc793b