Readline-8.0 patch 1: fix file descriptor leak with zero-length history file
authorChet Ramey <chet.ramey@case.edu>
Wed, 14 Aug 2019 15:28:48 +0000 (11:28 -0400)
committerTom Tromey <tom@tromey.com>
Tue, 30 Jun 2020 21:10:46 +0000 (15:10 -0600)
readline/readline/histfile.c
readline/readline/patchlevel

index dc64bde1c5acf8c117080eb7c783a2cd3181311d..a8a92aa3604a52216ff29a353e282482d80c4184 100644 (file)
@@ -305,6 +305,7 @@ read_history_range (const char *filename, int from, int to)
   if (file_size == 0)
     {
       free (input);
+      close (file);
       return 0;        /* don't waste time if we don't have to */
     }
 
index d8c9df7e6bb19b63a7c7f1c4f192a91529e40699..fdf474049fce8501d87e7b8fa7cf2b72cab0ad9b 100644 (file)
@@ -1,3 +1,3 @@
 # Do not edit -- exists only for use by patch
 
-0
+1