]> Savannah Git Hosting - gnulib.git/commitdiff
javacomp: Fix resource leak.
authorBruno Haible <bruno@clisp.org>
Thu, 1 May 2025 15:28:06 +0000 (17:28 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 1 May 2025 15:28:27 +0000 (17:28 +0200)
* lib/javacomp.c (execute_and_read_line): Upon failure, close the stream
and wait for the child process to terminate.

ChangeLog
lib/javacomp.c

index 463cd83a9cb2f80cf85c700fb63ff6c58be7842f..6026666ac07bb1c88bf814cb01e604d92e3b143c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-05-01  Bruno Haible  <bruno@clisp.org>
+
+       javacomp: Fix resource leak.
+       * lib/javacomp.c (execute_and_read_line): Upon failure, close the stream
+       and wait for the child process to terminate.
+
 2025-04-30  Bruno Haible  <bruno@clisp.org>
 
        New module hashcode-string1.
index c024c15a661523a34bbb626aa9e5d8ba465378ed..33ec8eb63e4b5c109d83b2d33dbdc4764344b23e 100644 (file)
@@ -359,6 +359,8 @@ execute_and_read_line (const char *progname,
   if (linelen == (size_t)(-1))
     {
       error (0, 0, _("%s subprocess I/O error"), progname);
+      fclose (fp);
+      wait_subprocess (child, progname, true, false, true, false, NULL);
       return NULL;
     }
   if (linelen > 0 && line[linelen - 1] == '\n')