tsm: unicode: fix not recreating the default-table all the time

We actually created a new table all the time which led to huge memory
leaks. We now actually use the default table if it is available.

Signed-off-by: David Herrmann <dh.herrmann@googlemail.com>
This commit is contained in:
David Herrmann committed 2012-09-27 12:11:52 +02:00
1 parent de2536f4e4
commit 090ead3bd6
1 file changed
+6
+6
View File
@@ -233,6 +233,9 @@ const uint32_t *tsm_symbol_get(struct tsm_symbol_table *tbl,
return sym;
}
if (!tbl)
tbl = tsm_symbol_table_default;
if (!tbl) {
ret = tsm_symbol_table_new(&tbl);
if (ret) {
@@ -270,6 +273,9 @@ tsm_symbol_t tsm_symbol_append(struct tsm_symbol_table *tbl,
bool res;
int ret;
if (!tbl)
tbl = tsm_symbol_table_default;
if (!tbl) {
ret = tsm_symbol_table_new(&tbl);
if (ret)