mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
Reduce diff against my local version: replace malloc+memset() cases to calloc().
This commit is contained in:
parent
0c794c5db1
commit
216fa4c607
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=192153
@ -191,8 +191,7 @@ amd64_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -194,8 +194,7 @@ amd64_fbsd32_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -164,8 +164,7 @@ amd64_linux32_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -184,8 +184,7 @@ i386_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -164,8 +164,7 @@ i386_linux_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -166,8 +166,7 @@ ia64_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -179,11 +179,10 @@ main(int ac, char **av)
|
||||
initial_open = 1;
|
||||
|
||||
/* Initialize the trussinfo struct */
|
||||
trussinfo = (struct trussinfo *)malloc(sizeof(struct trussinfo));
|
||||
trussinfo = (struct trussinfo *)calloc(1, sizeof(struct trussinfo));
|
||||
if (trussinfo == NULL)
|
||||
errx(1, "malloc() failed");
|
||||
bzero(trussinfo, sizeof(struct trussinfo));
|
||||
|
||||
errx(1, "calloc() failed");
|
||||
|
||||
trussinfo->outfile = stderr;
|
||||
trussinfo->strsize = 32;
|
||||
trussinfo->pr_why = S_NONE;
|
||||
|
@ -211,8 +211,7 @@ mips_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -193,8 +193,7 @@ powerpc_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
@ -209,8 +209,7 @@ sparc64_syscall_entry(struct trussinfo *trussinfo, int nargs) {
|
||||
fsc.nargs = nargs;
|
||||
}
|
||||
|
||||
fsc.s_args = malloc((1+fsc.nargs) * sizeof(char*));
|
||||
memset(fsc.s_args, 0, fsc.nargs * sizeof(char*));
|
||||
fsc.s_args = calloc(1, (1+fsc.nargs) * sizeof(char*));
|
||||
fsc.sc = sc;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user