This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] iconv add iconv_close before the function returned with bad value.
- From: liqingqing <liqingqing3 at huawei dot com>
- To: <libc-alpha at sourceware dot org>, <fweimer at redhat dot com>, <carlos at redhat dot com>
- Cc: <hushiyuan at huawei dot com>, <liusirui at huawei dot com>
- Date: Sat, 14 Dec 2019 16:18:51 +0800
- Subject: [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