We've received the following report from a reporter:
https://bugzilla.novell.com/show_bug.cgi?id=543132 :

--------------------
source code file cpio-2.10/src/copyin.c
function process_copy_in
local variable tty_out.

I notice the following code

      tty_out = fopen (TTY_NAME, "w");

but I fail to notice a matching call to fclose. This looks like a resource
leak to me. Suggest add call to fclose near the end of the function.
--------------------


I also attach suggested fix from Robert Schweikert

thanks


Index: src/copyin.c
===================================================================
--- src/copyin.c.orig
+++ src/copyin.c
@@ -1565,6 +1565,19 @@ process_copy_in ()
   if (dot_flag)
     fputc ('\n', stderr);
 
+  if (tty_in)
+    {
+      fclose(tty_in);
+    }
+  if (tty_out)
+    {
+      fclose(tty_out);
+    }
+  if (rename_in)
+    {
+      fclose(rename_in);
+    }
+
   if (append_flag)
     return;
 


Reply via email to