summaryrefslogtreecommitdiff
path: root/libasm/asm_align.c
diff options
context:
space:
mode:
Diffstat (limited to 'libasm/asm_align.c')
-rw-r--r--libasm/asm_align.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libasm/asm_align.c b/libasm/asm_align.c
index e59a070e..c8c671b2 100644
--- a/libasm/asm_align.c
+++ b/libasm/asm_align.c
@@ -143,7 +143,7 @@ __libasm_ensure_section_space (AsmScn_t *asmscn, size_t len)
/* This is the first block. */
size = MAX (2 * len, 960);
- asmscn->content = (struct AsmData *) malloc (sizeof (struct AsmData)
+ asmscn->content = (struct AsmData *) calloc (1, sizeof (struct AsmData)
+ size);
if (asmscn->content == NULL)
return -1;
@@ -160,7 +160,7 @@ __libasm_ensure_section_space (AsmScn_t *asmscn, size_t len)
size = MAX (2 *len, MIN (32768, 2 * asmscn->offset));
- newp = (struct AsmData *) malloc (sizeof (struct AsmData) + size);
+ newp = (struct AsmData *) calloc (1, sizeof (struct AsmData) + size);
if (newp == NULL)
return -1;