From: Siddhesh Poyarekar Date: Tue, 18 May 2021 03:53:48 +0000 (+0530) Subject: charmap_conversion: Free conversion table on exit X-Git-Tag: glibc-2.34~393 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c8c3c5e89a5f6a9d41d244e9803ccaf4250e7e62;p=thirdparty%2Fglibc.git charmap_conversion: Free conversion table on exit The conversion table is allocated using xcalloc but never freed. Reviewed-by: Adhemerval Zanella --- diff --git a/iconv/iconv_charmap.c b/iconv/iconv_charmap.c index f76b3ce2b10..e2d53fee3cb 100644 --- a/iconv/iconv_charmap.c +++ b/iconv/iconv_charmap.c @@ -53,6 +53,12 @@ allocate_table (void) return (struct convtable *) xcalloc (1, sizeof (struct convtable)); } +static inline void +free_table (struct convtable *tbl) +{ + free (tbl); +} + static inline int is_term (struct convtable *tbl, unsigned int idx) @@ -228,6 +234,7 @@ charmap_conversion (const char *from_code, struct charmap_t *from_charmap, while (++remaining < argc); /* All done. */ + free_table (cvtbl); return status; }