summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--assemble.c2
-rw-r--r--parser.c7
2 files changed, 4 insertions, 5 deletions
diff --git a/assemble.c b/assemble.c
index 7ab53ad..31955e5 100644
--- a/assemble.c
+++ b/assemble.c
@@ -349,8 +349,6 @@ int64_t assemble(int32_t segment, int64_t offset, int bits, uint32_t cp,
OUT_RAWDATA, align, NO_SEG, NO_SEG);
}
offset += e->stringlen + align;
- if (e->type == EOT_DB_STRING_FREE)
- nasm_free(e->stringval);
}
}
if (t > 0 && t == instruction->times - 1) {
diff --git a/parser.c b/parser.c
index caff1b1..a88e883 100644
--- a/parser.c
+++ b/parser.c
@@ -947,9 +947,10 @@ void cleanup_insn(insn * i)
{
extop *e;
- while (i->eops) {
- e = i->eops;
- i->eops = i->eops->next;
+ while ((e = i->eops)) {
+ i->eops = e->next;
+ if (e->type == EOT_DB_STRING_FREE)
+ nasm_free(e->stringval);
nasm_free(e);
}
}