aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Robinson <andr345@gmail.com>2009-05-19 18:50:31 +0200
committerAndreas Robinson <andr345@gmail.com>2009-05-21 12:31:21 +0200
commit8ec96766badb9ea57b7b666fe2a2aff2c7713236 (patch)
treefaee89b700cc5884bc2dc54eb6dcc9cfee00541e
parentb9d6de8434a516f0d8ce3114b0af6c3355bf5ef6 (diff)
downloadmodule-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.c2
-rw-r--r--elfops_core.c5
-rw-r--r--util.c2
-rw-r--r--util.h1
4 files changed, 6 insertions, 4 deletions
diff --git a/depmod.c b/depmod.c
index e636659..a8c3a47 100644
--- a/depmod.c
+++ b/depmod.c
@@ -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;
diff --git a/util.c b/util.c
index 3802a02..4df11e0 100644
--- a/util.c
+++ b/util.c
@@ -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)
{
diff --git a/util.h b/util.h
index d6112b0..d512072 100644
--- a/util.h
+++ b/util.h
@@ -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);