aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zpool
diff options
context:
space:
mode:
authorнаб <[email protected]>2022-03-08 22:50:45 +0100
committerBrian Behlendorf <[email protected]>2022-04-01 17:55:24 -0700
commita3dcc0aa0c0b7873265d0b014ea6133bd8e40591 (patch)
treeb8b9c716de42c23fa0554362ad76dfadf1677f0a /cmd/zpool
parent84a3eab6aa44dedaec6d3f5e6da9ccb4b9942907 (diff)
zfs, zpool: safe_malloc() duplicate argv
Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: John Kennedy <[email protected]> Reviewed-by: Ryan Moeller <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #13259
Diffstat (limited to 'cmd/zpool')
-rw-r--r--cmd/zpool/zpool_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zpool/zpool_main.c b/cmd/zpool/zpool_main.c
index 5d1cae3e9..043b6a226 100644
--- a/cmd/zpool/zpool_main.c
+++ b/cmd/zpool/zpool_main.c
@@ -10924,7 +10924,7 @@ main(int argc, char **argv)
* Many commands modify input strings for string parsing reasons.
* We create a copy to protect the original argv.
*/
- newargv = malloc((argc + 1) * sizeof (newargv[0]));
+ newargv = safe_malloc((argc + 1) * sizeof (newargv[0]));
for (i = 0; i < argc; i++)
newargv[i] = strdup(argv[i]);
newargv[argc] = NULL;