i18n: Only close valid iconv converters in i18n_done().
[pspp-builds.git] / src / libpspp / i18n.c
index 0e461db160dc5f69fcc65fcba1284192e1c44758..fbff1772a18b2748e21b2cb4a61a3b2f09734dae 100644 (file)
@@ -609,7 +609,8 @@ i18n_done (void)
     {
       free (cvtr->tocode);
       free (cvtr->fromcode);
-      iconv_close (cvtr->conv);
+      if (cvtr->conv != (iconv_t) -1)
+        iconv_close (cvtr->conv);
       free (cvtr);
     }