Fix setting of mailer argv[0] to basename of mailerpath.

No need to strdup() mailerpath as it is not modified.
This commit is contained in:
Todd C. Miller
2013-08-13 14:53:55 -06:00
parent 04b290e385
commit 91e66c481f

View File

@@ -640,7 +640,7 @@ send_mail(const char *fmt, ...)
case 0: case 0:
{ {
char *argv[MAX_MAILFLAGS + 1]; char *argv[MAX_MAILFLAGS + 1];
char *mpath, *mflags; char *mflags, *mpath = def_mailerpath;
int i; int i;
/* Child, set stdin to output side of the pipe */ /* Child, set stdin to output side of the pipe */
@@ -657,8 +657,7 @@ send_mail(const char *fmt, ...)
/* Build up an argv based on the mailer path and flags */ /* Build up an argv based on the mailer path and flags */
mflags = estrdup(def_mailerflags); mflags = estrdup(def_mailerflags);
mpath = estrdup(def_mailerpath); if ((argv[0] = strrchr(mpath, '/')))
if ((argv[0] = strrchr(mpath, ' ')))
argv[0]++; argv[0]++;
else else
argv[0] = mpath; argv[0] = mpath;