This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] iconv add iconv_close before the function returned with bad value.


add iconv_close before the function returned with bad value.

---
 iconv/tst-iconv5.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/iconv/tst-iconv5.c b/iconv/tst-iconv5.c
index 15fd5d3ae2e..15d9629e7d9 100644
--- a/iconv/tst-iconv5.c
+++ b/iconv/tst-iconv5.c
@@ -72,7 +72,10 @@ convert (const char *tocode, const char *fromcode, char *inbufp,
 	{
 	  printf ("iconv failed: from: %s, to: %s: %s",
 		  fromcode, tocode, strerror (errno));
-	  return -1;
+	  
+    iconv_close (ic);
+
+    return -1;
 	}
     }
 
-- 
2.23.0.windows.1



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