From c13deef255b621ace2130adf55530f3364a40458 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Mon, 28 Feb 2011 09:28:25 +0300 Subject: [PATCH] bin: Use nasm_zalloc for default section creation Signed-off-by: Cyrill Gorcunov --- output/outbin.c | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/output/outbin.c b/output/outbin.c index e1794b55..21c042db 100644 --- a/output/outbin.c +++ b/output/outbin.c @@ -1427,18 +1427,13 @@ static void binfmt_init(void) nsl_tail = &no_seg_labels; /* Create default section (.text). */ - sections = last_section = nasm_malloc(sizeof(struct Section)); - last_section->next = NULL; - last_section->name = nasm_strdup(".text"); - last_section->contents = saa_init(1L); - last_section->follows = last_section->vfollows = 0; - last_section->prev = NULL; - last_section->length = 0; - last_section->flags = TYPE_DEFINED | TYPE_PROGBITS; - last_section->labels = NULL; - last_section->labels_end = &(last_section->labels); - last_section->start_index = seg_alloc(); - last_section->vstart_index = seg_alloc(); + sections = last_section = nasm_zalloc(sizeof(struct Section)); + last_section->name = nasm_strdup(".text"); + last_section->contents = saa_init(1L); + last_section->flags = TYPE_DEFINED | TYPE_PROGBITS; + last_section->labels_end = &(last_section->labels); + last_section->start_index = seg_alloc(); + last_section->vstart_index = seg_alloc(); } /* Generate binary file output */ -- 2.11.4.GIT