diff options
author | Damien Miller <djm@cvs.openbsd.org> | 2006-04-02 21:38:58 +0000 |
---|---|---|
committer | Damien Miller <djm@cvs.openbsd.org> | 2006-04-02 21:38:58 +0000 |
commit | 5b14fea36497511e6428b2c588513d92bc92cb90 (patch) | |
tree | 0b66759932d131cfb42148e0672334d215e6b99f /usr.bin/elf2aout/elf2aout.c | |
parent | ba37f6b6fd488dbe7dd7be429e8b7a994a783155 (diff) |
malloc(x * y) -> calloc(x, y) from adobriyan AT gmail.com, with tweaks
suggested by kjell@; ok otto@ pat@ millert@ jaredy@
Diffstat (limited to 'usr.bin/elf2aout/elf2aout.c')
-rw-r--r-- | usr.bin/elf2aout/elf2aout.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.bin/elf2aout/elf2aout.c b/usr.bin/elf2aout/elf2aout.c index dd714bfe98b..acca8a6cbc8 100644 --- a/usr.bin/elf2aout/elf2aout.c +++ b/usr.bin/elf2aout/elf2aout.c @@ -1,4 +1,4 @@ -/* $OpenBSD: elf2aout.c,v 1.5 2004/03/16 01:11:09 tedu Exp $ */ +/* $OpenBSD: elf2aout.c,v 1.6 2006/04/02 21:38:56 djm Exp $ */ /* * Copyright (c) 1995 @@ -129,12 +129,11 @@ usage: * Find space for a table matching ELF section indices to a.out * symbol types. */ - symTypeTable = (int *) malloc(ex.e_shnum * sizeof(int)); + symTypeTable = calloc(ex.e_shnum, sizeof(int)); if (!symTypeTable) { fprintf(stderr, "symTypeTable: can't allocate.\n"); exit(1); } - memset(symTypeTable, 0, ex.e_shnum * sizeof(int)); /* * Look for the symbol table and string table... Also map section |