From: Paul Eggert Date: Sat, 5 Mar 2016 00:29:55 +0000 (-0800) Subject: doc string file descriptor exhaustion fix X-Git-Tag: emacs-25.0.93~133 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=c45a1ca3c4eed56be6ad8086dcc805a86bc5935c;p=emacs.git doc string file descriptor exhaustion fix * src/doc.c (get_doc_string): Move newly-added check to a better location (Bug#22814). --- diff --git a/src/doc.c b/src/doc.c index 6e7906578a4..a20ecbdb753 100644 --- a/src/doc.c +++ b/src/doc.c @@ -126,9 +126,6 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) fd = emacs_open (name, O_RDONLY, 0); if (fd < 0) { - if ((errno == EMFILE) || (errno == ENFILE)) - report_file_error ("Read error on documentation file", file); - #ifndef CANNOT_DUMP if (!NILP (Vpurify_flag)) { @@ -141,6 +138,9 @@ get_doc_string (Lisp_Object filepos, bool unibyte, bool definition) #endif if (fd < 0) { + if (errno == EMFILE || errno == ENFILE) + report_file_error ("Read error on documentation file", file); + SAFE_FREE (); AUTO_STRING (cannot_open, "Cannot open doc string file \""); AUTO_STRING (quote_nl, "\"\n");