diff options
author | paul <paul@FreeBSD.org> | 2001-06-04 04:22:57 +0000 |
---|---|---|
committer | paul <paul@FreeBSD.org> | 2001-06-04 04:22:57 +0000 |
commit | dc5b94d7317d778719fc58ce4c37482ee24f10b7 (patch) | |
tree | fdad5e11984efad9c8c605e7bff9fa4e779c5a2d /usr.sbin | |
parent | 7f9e5322905b494d6f28f9afbc36e58c55ddd46a (diff) | |
download | FreeBSD-src-dc5b94d7317d778719fc58ce4c37482ee24f10b7.zip FreeBSD-src-dc5b94d7317d778719fc58ce4c37482ee24f10b7.tar.gz |
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.
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/mailwrapper/mailwrapper.c | 3 |
1 files changed, 2 insertions, 1 deletions
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); |