diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-02-20 12:41:52 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-02-20 12:41:52 +0000 |
commit | 33e9b7f59adeaef1a835fc3f6786814ecc9517d2 (patch) | |
tree | 5e35090ecfc88bc31ca6c9034cf342df78df602d /gnu | |
parent | ef618e7d1f677bfe26b07a47c1eaa27ce54a6c69 (diff) |
Fix a use-after-free bug in the envelope code just after a port 25 fork.
From Matthew Dillon@DragonFlyBSD
ok millert@ dlg@
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.sbin/sendmail/sendmail/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gnu/usr.sbin/sendmail/sendmail/main.c b/gnu/usr.sbin/sendmail/sendmail/main.c index 7963d92be7e..c3b12a67e6e 100644 --- a/gnu/usr.sbin/sendmail/sendmail/main.c +++ b/gnu/usr.sbin/sendmail/sendmail/main.c @@ -2517,9 +2517,12 @@ main(argc, argv, envp) macdefine(&BlankEnvelope.e_macro, A_TEMP, '_', authinfo); /* at this point we are in a child: reset state */ - sm_rpool_free(MainEnvelope.e_rpool); - (void) newenvelope(&MainEnvelope, &MainEnvelope, - sm_rpool_new_x(NULL)); + { + SM_RPOOL_T *opool = MainEnvelope.e_rpool; + (void) newenvelope(&MainEnvelope, &MainEnvelope, + sm_rpool_new_x(NULL)); + sm_rpool_free(opool); + } } if (LogLevel > 9) |