From 538492c299dc8daa7f6df843f3eba0bd884a078d Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 30 Aug 2018 11:58:01 +0000 Subject: [PATCH] fix use-after-free spotted by jsg@ input from jsg@ miko@ --- usr.sbin/smtpd/smtp_client.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.sbin/smtpd/smtp_client.c b/usr.sbin/smtpd/smtp_client.c index 289ff3b2441..8b28f3a6d86 100644 --- a/usr.sbin/smtpd/smtp_client.c +++ b/usr.sbin/smtpd/smtp_client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_client.c,v 1.5 2018/06/09 10:01:17 eric Exp $ */ +/* $OpenBSD: smtp_client.c,v 1.6 2018/08/30 11:58:01 eric Exp $ */ /* * Copyright (c) 2018 Eric Faurot @@ -209,13 +209,13 @@ smtp_client_free(struct smtp_client *proto) if (proto->mail) fatalx("current task should have been deleted already"); + smtp_closed(proto->tag, proto); + if (proto->io) io_free(proto->io); free(proto->reply); free(proto); - - smtp_closed(proto->tag, proto); } /* -- 2.20.1