public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED 1/3] charmap_conversion: Free conversion table on exit
@ 2021-05-18  4:40 Siddhesh Poyarekar
  2021-05-18  4:40 ` [COMMITTED 2/3] ldconfig: Fix memory leaks Siddhesh Poyarekar
  2021-05-18  4:40 ` [COMMITTED 3/3] ldconfig: Avoid boolean coercion of opt_chroot Siddhesh Poyarekar
  0 siblings, 2 replies; 3+ messages in thread
From: Siddhesh Poyarekar @ 2021-05-18  4:40 UTC (permalink / raw)
  To: libc-alpha

The conversion table is allocated using xcalloc but never freed.

Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
---
 iconv/iconv_charmap.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/iconv/iconv_charmap.c b/iconv/iconv_charmap.c
index f76b3ce2b1..e2d53fee3c 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;
 }
 
-- 
2.31.1


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

end of thread, other threads:[~2021-05-18  4:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-18  4:40 [COMMITTED 1/3] charmap_conversion: Free conversion table on exit Siddhesh Poyarekar
2021-05-18  4:40 ` [COMMITTED 2/3] ldconfig: Fix memory leaks Siddhesh Poyarekar
2021-05-18  4:40 ` [COMMITTED 3/3] ldconfig: Avoid boolean coercion of opt_chroot 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).