diff options
author | Tobias Bergkvist <tobias@bergkv.ist> | 2021-12-01 23:07:30 +0100 |
---|---|---|
committer | Tobias Bergkvist <tobias@bergkv.ist> | 2021-12-01 23:07:30 +0100 |
commit | 3997e9de6794e3227aa0c852647abda42d8a8fe6 (patch) | |
tree | 18b42222cb96a4d55ff2e42b9a8fc079b4e5290f /pkgs/test | |
parent | 97d62a90f5ba28d6f16f40d20a679862394be8c2 (diff) |
Switch from malloc to calloc in addFlags
Diffstat (limited to 'pkgs/test')
-rw-r--r-- | pkgs/test/make-binary-wrapper/add-flags.c | 2 | ||||
-rw-r--r-- | pkgs/test/make-binary-wrapper/combination.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/test/make-binary-wrapper/add-flags.c b/pkgs/test/make-binary-wrapper/add-flags.c index fccd5aa9402a..20d3b7508c05 100644 --- a/pkgs/test/make-binary-wrapper/add-flags.c +++ b/pkgs/test/make-binary-wrapper/add-flags.c @@ -7,7 +7,7 @@ #include <assert.h> int main(int argc, char **argv) { - char **argv_tmp = malloc(sizeof(*argv_tmp) * (5 + argc)); + char **argv_tmp = calloc(5 + argc, sizeof(*argv_tmp)); assert(argv_tmp != NULL); argv_tmp[0] = argv[0]; argv_tmp[1] = "-x"; diff --git a/pkgs/test/make-binary-wrapper/combination.c b/pkgs/test/make-binary-wrapper/combination.c index c476b24394d8..4ab44281ef14 100644 --- a/pkgs/test/make-binary-wrapper/combination.c +++ b/pkgs/test/make-binary-wrapper/combination.c @@ -47,7 +47,7 @@ int main(int argc, char **argv) { set_env_suffix("PATH", ":", "/usr/local/bin/"); putenv("MESSAGE2=WORLD"); - char **argv_tmp = malloc(sizeof(*argv_tmp) * (4 + argc)); + char **argv_tmp = calloc(4 + argc, sizeof(*argv_tmp)); assert(argv_tmp != NULL); argv_tmp[0] = argv[0]; argv_tmp[1] = "-x"; |