You can't free a string and then use it as the error message to
errx. Instead use warn to print the string, then cleanup and exit normally. This fixes a core dump if the executable to be run doesn't exist.
This commit is contained in:
parent
1b3e974a71
commit
57b6c4a55a
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=77679
@ -176,8 +176,9 @@ main(argc, argv, envp)
|
|||||||
addarg(&al, NULL, 0);
|
addarg(&al, NULL, 0);
|
||||||
execve(to, al.argv, envp);
|
execve(to, al.argv, envp);
|
||||||
freearg(&al, 0);
|
freearg(&al, 0);
|
||||||
|
warn("execing %s", to);
|
||||||
free(line);
|
free(line);
|
||||||
err(1, "execing %s", to);
|
exit(1);
|
||||||
/*NOTREACHED*/
|
/*NOTREACHED*/
|
||||||
parse_error:
|
parse_error:
|
||||||
freearg(&al, 0);
|
freearg(&al, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user