mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-08 22:30:07 +00:00
charmap_conversion: Free conversion table on exit
The conversion table is allocated using xcalloc but never freed. Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
This commit is contained in:
parent
a85cdcdb35
commit
c8c3c5e89a
@ -53,6 +53,12 @@ allocate_table (void)
|
|||||||
return (struct convtable *) xcalloc (1, sizeof (struct convtable));
|
return (struct convtable *) xcalloc (1, sizeof (struct convtable));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline void
|
||||||
|
free_table (struct convtable *tbl)
|
||||||
|
{
|
||||||
|
free (tbl);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static inline int
|
static inline int
|
||||||
is_term (struct convtable *tbl, unsigned int idx)
|
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);
|
while (++remaining < argc);
|
||||||
|
|
||||||
/* All done. */
|
/* All done. */
|
||||||
|
free_table (cvtbl);
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user