diff options
author | Cyrill Gorcunov <gorcunov@gmail.com> | 2011-02-28 09:28:25 +0300 |
---|---|---|
committer | Cyrill Gorcunov <gorcunov@gmail.com> | 2011-02-28 09:28:25 +0300 |
commit | c13deef255b621ace2130adf55530f3364a40458 (patch) | |
tree | 48e18509d6449d712a63c5ec9e0bb980dbaacd8c | |
parent | 6b27129f80a5652f3b14e3f7cebfc4a39ed7d839 (diff) | |
download | nasm-c13deef255b621ace2130adf55530f3364a40458.tar.gz |
bin: Use nasm_zalloc for default section creation
Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r-- | output/outbin.c | 19 |
1 files 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 */ |