use utils::strdup() for duplicating strings

This commit is contained in:
Axel Kohlmeyer
2021-03-15 15:31:25 -04:00
parent a6a2879807
commit ece2433208
6 changed files with 21 additions and 54 deletions

View File

@ -554,9 +554,7 @@ int utils::expand_args(const char *file, int line, int narg, char **arg,
earg = (char **)
lmp->memory->srealloc(earg,maxarg*sizeof(char *),"input:earg");
}
n = strlen(arg[iarg]) + 1;
earg[newarg] = new char[n];
strcpy(earg[newarg],arg[iarg]);
earg[newarg] = utils::strdup(arg[iarg]);
newarg++;
}
}