From dc5b94d7317d778719fc58ce4c37482ee24f10b7 Mon Sep 17 00:00:00 2001 From: paul Date: Mon, 4 Jun 2001 04:22:57 +0000 Subject: 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. --- usr.sbin/mailwrapper/mailwrapper.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'usr.sbin/mailwrapper') diff --git a/usr.sbin/mailwrapper/mailwrapper.c b/usr.sbin/mailwrapper/mailwrapper.c index 509496b..7d6ad14 100644 --- a/usr.sbin/mailwrapper/mailwrapper.c +++ b/usr.sbin/mailwrapper/mailwrapper.c @@ -176,8 +176,9 @@ main(argc, argv, envp) addarg(&al, NULL, 0); execve(to, al.argv, envp); freearg(&al, 0); + warn("execing %s", to); free(line); - err(1, "execing %s", to); + exit(1); /*NOTREACHED*/ parse_error: freearg(&al, 0); -- cgit v1.1