summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-11-10 14:46:19 +0000
committerJacek Masiulaniec <jacekm@cvs.openbsd.org>2009-11-10 14:46:19 +0000
commit51824e5313975f6606bb639fae32ef5f3772761e (patch)
tree6c5f9bd7ae7aaf9fa3d06e2b257a4d342f7226ff
parent46ab202cd04dd23be9d6193d4d00318d184ecf78 (diff)
In relay case, avoid freeing garbage pointer by copying the required struct
from the temporary imsg buffer. ok gilles@
-rw-r--r--usr.sbin/smtpd/lka.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c
index d6d18ff6f80..1cd9517388c 100644
--- a/usr.sbin/smtpd/lka.c
+++ b/usr.sbin/smtpd/lka.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka.c,v 1.92 2009/11/10 10:25:11 jacekm Exp $ */
+/* $OpenBSD: lka.c,v 1.93 2009/11/10 14:46:18 jacekm Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -983,6 +983,7 @@ int
lka_resolve_path(struct smtpd *env, struct lkasession *lkasession, struct path *path)
{
if (IS_RELAY(*path) || path->cond == NULL) {
+ path = path_dup(path);
path->flags |= F_PATH_RELAY;
TAILQ_INSERT_TAIL(&lkasession->deliverylist, path, entry);
return 1;