diff mbox

iconv add iconv_close before the function returned with bad value.

Message ID 20191214081851.378-1-liqingqing3@huawei.com
State New
Headers show

Commit Message

liqingqing Dec. 14, 2019, 8:18 a.m. UTC
add iconv_close before the function returned with bad value.

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

Patch

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;
 	}
     }