public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] iconv add iconv_close before the function returned with bad value.
@ 2019-12-14  8:19 liqingqing
  2020-12-21  4:28 ` [COMMITTED] " Siddhesh Poyarekar
  0 siblings, 1 reply; 2+ messages in thread
From: liqingqing @ 2019-12-14  8:19 UTC (permalink / raw)
  To: libc-alpha, fweimer, carlos; +Cc: hushiyuan, liusirui

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [COMMITTED] iconv add iconv_close before the function returned with bad value.
  2019-12-14  8:19 [PATCH] iconv add iconv_close before the function returned with bad value liqingqing
@ 2020-12-21  4:28 ` Siddhesh Poyarekar
  0 siblings, 0 replies; 2+ messages in thread
From: Siddhesh Poyarekar @ 2020-12-21  4:28 UTC (permalink / raw)
  To: libc-alpha

From: liqingqing <liqingqing3@huawei.com>

Fixed up whitespaces and committed -- Siddhesh

add iconv_close before the function returned with bad value.
---
 iconv/tst-iconv5.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/iconv/tst-iconv5.c b/iconv/tst-iconv5.c
index 8211843e4f..09cec9c4bf 100644
--- a/iconv/tst-iconv5.c
+++ b/iconv/tst-iconv5.c
@@ -72,6 +72,7 @@ convert (const char *tocode, const char *fromcode, char *inbufp,
 	{
 	  printf ("iconv failed: from: %s, to: %s: %s",
 		  fromcode, tocode, strerror (errno));
+	  iconv_close (ic);
 	  return -1;
 	}
     }
-- 
2.29.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-12-21  4:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-14  8:19 [PATCH] iconv add iconv_close before the function returned with bad value liqingqing
2020-12-21  4:28 ` [COMMITTED] " Siddhesh Poyarekar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).