-/* $OpenBSD: crunchgen.c,v 1.9 1997/01/31 19:40:42 rahnds Exp $ */
+/* $OpenBSD: crunchgen.c,v 1.10 1997/04/04 21:52:40 mickey Exp $ */
/*
* Copyright (c) 1994 University of Maryland
* All Rights Reserved.
for(p1 = NULL, p2 = progs; p2 != NULL; p1 = p2, p2 = p2->next)
if(!strcmp(p2->name, progname)) return;
- p2 = malloc(sizeof(prog_t));
+ p2 = calloc(1, sizeof(prog_t));
if(p2) p2->name = strdup(progname);
if(!p2 || !p2->name)
out_of_memory();
for(p1 = NULL, p2 = *listp; p2 != NULL; p1 = p2, p2 = p2->next)
if(!strcmp(p2->str, str)) return;
- p2 = malloc(sizeof(strlst_t));
+ p2 = calloc(1,sizeof(strlst_t));
if(p2) p2->str = strdup(str);
if(!p2 || !p2->str)
out_of_memory();
if(curp && cmp == 0)
return; /* already in table */
- newp = (struct keep *) malloc(sizeof(struct keep));
+ newp = (struct keep *) calloc(1,sizeof(struct keep));
if(newp) newp->sym = strdup(symbol);
if(newp == NULL || newp->sym == NULL) {
fprintf(stderr, "%s: out of memory for keep list\n", pname);
* read the header and from TRELOFF to the end of the file.
*/
- if((aoutdata = (char *) malloc(infstat.st_size)) == NULL) {
+ if((aoutdata = (char *) calloc(1,infstat.st_size)) == NULL) {
fprintf(stderr, "%s: too big to read into memory\n", filename);
close(inf);
return;
-/* $OpenBSD: elf_hide.c,v 1.1 1997/01/09 04:16:52 rahnds Exp $ */
+/* $OpenBSD: elf_hide.c,v 1.2 1997/04/04 21:52:42 mickey Exp $ */
/*
* Copyright (c) 1997 Dale Rahn. All rights reserved.
nsyms = symtabsize / sizeof(Elf32_Sym);
- tmpsymtab = (Elf32_Sym *)malloc(symtabsize);
- symmap = (Symmap *)malloc( sizeof(Symmap) * (nsyms));
+ tmpsymtab = (Elf32_Sym *)calloc(1,symtabsize);
+ symmap = (Symmap *)calloc(1, sizeof(Symmap) * (nsyms));
assert (NULL != tmpsymtab);