use hash for name lookup
diff --git a/libasn1fix/asn1fix_cws.c b/libasn1fix/asn1fix_cws.c
index 948c627..e54eaa7 100644
--- a/libasn1fix/asn1fix_cws.c
+++ b/libasn1fix/asn1fix_cws.c
@@ -389,7 +389,6 @@
char *mivr; /* Most Immediate Value Representation */
int new_ref = 1;
asn1p_t *asn;
- asn1p_module_t *mod;
asn1p_expr_t *type_expr = (asn1p_expr_t *)NULL;
int i, ret = 0, psize;
char *pp;
@@ -458,9 +457,13 @@
free(mivr);
return -1;
} else {
- mod = TQ_FIRST(&(asn->modules));
- assert(mod);
- expr = TQ_REMOVE(&(mod->members), next);
+ asn1p_module_t *mod = TQ_FIRST(&(asn->modules));
+ assert(mod);
+
+ /* This member removal is safe with respect to members hash since the
+ * entire asn module will be deleted down below.
+ */
+ expr = TQ_REMOVE(&(mod->members), next);
assert(expr);
expr->parent_expr = NULL;