diff options
author | Andreas Robinson <andr345@gmail.com> | 2009-05-19 18:50:31 +0200 |
---|---|---|
committer | Andreas Robinson <andr345@gmail.com> | 2009-05-21 12:31:21 +0200 |
commit | 8ec96766badb9ea57b7b666fe2a2aff2c7713236 (patch) | |
tree | faee89b700cc5884bc2dc54eb6dcc9cfee00541e | |
parent | b9d6de8434a516f0d8ce3114b0af6c3355bf5ef6 (diff) | |
download | module-init-tools-8ec96766badb9ea57b7b666fe2a2aff2c7713236.tar.gz |
fix minor strtbl_free and strtbl_add problems
- add missing NOFAIL to strtbl_add() in load_dep_syms()
- export strtbl_free()
- free string tables with strtbl_free()
- documentation fix
Signed-off-by: Andreas Robinson <andr345@gmail.com>
-rw-r--r-- | depmod.c | 2 | ||||
-rw-r--r-- | elfops_core.c | 5 | ||||
-rw-r--r-- | util.c | 2 | ||||
-rw-r--r-- | util.h | 1 |
4 files changed, 6 insertions, 4 deletions
@@ -693,7 +693,7 @@ static struct module *parse_modules(struct module *list) if (syms) { for (j = 0; j < syms->cnt; j++) add_symbol(syms->str[j], i); - free(syms); + strtbl_free(syms); } file->ops->fetch_tables(file, &i->tables); } diff --git a/elfops_core.c b/elfops_core.c index 39fd4c3..1e8083b 100644 --- a/elfops_core.c +++ b/elfops_core.c @@ -190,8 +190,9 @@ static struct string_table *PERBIT(load_dep_syms)(const char *pathname, weak = (ELFPERBIT(ST_BIND)(END(syms[i].st_info, conv)) == STB_WEAK); - names = strtbl_add(name, names); - *types = strtbl_add(weak ? weak_sym : undef_sym, *types); + names = NOFAIL(strtbl_add(name, names)); + *types = NOFAIL(strtbl_add(weak ? weak_sym : undef_sym, + *types)); } } return names; @@ -152,7 +152,7 @@ struct string_table *strtbl_add(const char *str, struct string_table *tbl) } /* - * strtbl_destroy - string table destructor + * strtbl_free - string table destructor */ void strtbl_free(struct string_table *tbl) { @@ -17,6 +17,7 @@ char *underscores(char *string); char *my_basename(const char *path); struct string_table *strtbl_add(const char *str, struct string_table *tbl); +void strtbl_free(struct string_table *tbl); const char *next_string(const char *string, unsigned long *secsize); |