Blob Blame History Raw
commit 9995d0588f4f9adc68419224d2b3698e2ca4f77e
Author: Siddhesh Poyarekar <siddhesh@sourceware.org>
Date:   Tue Aug 3 21:10:29 2021 +0530

    iconv_charmap: Close output file when done
    
    Reviewed-by: Arjun Shankar <arjun@redhat.com>
    (cherry picked from commit 1e0e6d656db9dfa12ef7eb67976385d3deb0d4ff)

diff --git a/iconv/iconv_charmap.c b/iconv/iconv_charmap.c
index e2d53fee3cbfbb7a..a8b6b56124909f6c 100644
--- a/iconv/iconv_charmap.c
+++ b/iconv/iconv_charmap.c
@@ -234,6 +234,8 @@ charmap_conversion (const char *from_code, struct charmap_t *from_charmap,
     while (++remaining < argc);
 
   /* All done.  */
+  if (output != stdout)
+    fclose (output);
   free_table (cvtbl);
   return status;
 }