This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] lto-wrapper.c (copy_file): Fix resource leaks


Add missing fclose
CID 1407987, 1407986

S


>From d255827a64012fb81937d6baa8534eabecf9b735 Mon Sep 17 00:00:00 2001
From: Sylvestre Ledru <sylvestre@debian.org>
Date: Sun, 14 May 2017 11:37:37 +0200
Subject: [PATCH 5/5] 2017-05-14  Sylvestre Ledru  <sylvestre@debian.org>

	* lto-wrapper.c (copy_file): Fix resource leaks
          CID 1407987, 1407986
---
 gcc/lto-wrapper.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/lto-wrapper.c b/gcc/lto-wrapper.c
index 4b86f939ca2..832ffde3e40 100644
--- a/gcc/lto-wrapper.c
+++ b/gcc/lto-wrapper.c
@@ -838,6 +838,8 @@ copy_file (const char *dest, const char *src)
 	    fatal_error (input_location, "writing output file");
 	}
     }
+  fclose (d);
+  fclose (s);
 }
 
 /* Find the crtoffloadtable.o file in LIBRARY_PATH, make copy and pass name of
-- 
2.11.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]