From patchwork Sat Dec 14 08:18:51 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qingqing Li X-Patchwork-Id: 36872 Received: (qmail 126413 invoked by alias); 14 Dec 2019 08:19:09 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 126404 invoked by uid 89); 14 Dec 2019 08:19:08 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-18.5 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.1 spammy=HX-Languages-Length:604, H*r:0800 X-HELO: huawei.com From: liqingqing To: , , CC: , Subject: [PATCH] iconv add iconv_close before the function returned with bad value. Date: Sat, 14 Dec 2019 16:18:51 +0800 Message-ID: <20191214081851.378-1-liqingqing3@huawei.com> MIME-Version: 1.0 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; } }