* bytecode.c (yasm_bc_create_insn): Initialize operands list if none were
given.
* section.c (yasm_object_destroy): Free filenames.
* gas-token.c (fill): Use memmove instead of memcpy on overlapping memory
copy.
* nasm-token.c (fill): Likewise.
* elf.c (elf_secthead_destroy): Free size member.
svn path=/trunk/yasm/; revision=1399
insn->num_operands = num_operands;
if (operands)
insn->operands = *operands; /* structure copy */
+ else
+ STAILQ_INIT(&insn->operands);
insn->num_prefixes = 0;
insn->prefixes = NULL;
insn->num_segregs = 0;
cur = next;
}
+ /* Delete associated filenames */
+ yasm_xfree(object->src_filename);
+ yasm_xfree(object->obj_filename);
+
/* Delete symbol table and line mappings */
yasm_symtab_destroy(object->symtab);
yasm_linemap_destroy(object->linemap);
if (shead == NULL)
yasm_internal_error(N_("shead is null"));
+ yasm_intnum_destroy(shead->size);
+
yasm_xfree(shead);
}
if(!s->eof){
size_t cnt = s->tok - s->bot;
if(cnt){
- memcpy(s->bot, s->tok, (size_t)(s->lim - s->tok));
+ memmove(s->bot, s->tok, (size_t)(s->lim - s->tok));
s->tok = s->bot;
s->ptr -= cnt;
cursor -= cnt;
if(!s->eof){
size_t cnt = s->tok - s->bot;
if(cnt){
- memcpy(s->bot, s->tok, (size_t)(s->lim - s->tok));
+ memmove(s->bot, s->tok, (size_t)(s->lim - s->tok));
s->tok = s->bot;
s->ptr -= cnt;
cursor -= cnt;