summaryrefslogtreecommitdiff
path: root/sbin
diff options
context:
space:
mode:
authorYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2016-04-04 17:35:08 +0000
committerYASUOKA Masahiko <yasuoka@cvs.openbsd.org>2016-04-04 17:35:08 +0000
commit9550b5c20eb6521c6be55ff7a01473d287609743 (patch)
tree4b094526ca9d865f5ec2c73d35bff1796be0505e /sbin
parent4fcb160d368bb12ae853f121a429c511112333ce (diff)
Fix memory leak. Call proto_free() always to free proto.
Diff from Yuuichi Someya. ok reyk markus
Diffstat (limited to 'sbin')
-rw-r--r--sbin/isakmpd/message.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/sbin/isakmpd/message.c b/sbin/isakmpd/message.c
index 30d8e718211..ee0df3a4282 100644
--- a/sbin/isakmpd/message.c
+++ b/sbin/isakmpd/message.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: message.c,v 1.128 2015/08/20 22:02:21 deraadt Exp $ */
+/* $OpenBSD: message.c,v 1.129 2016/04/04 17:35:07 yasuoka Exp $ */
/* $EOM: message.c,v 1.156 2000/10/10 12:36:39 provos Exp $ */
/*
@@ -2182,7 +2182,7 @@ retry_transform:
* the SA.
*/
while ((proto = TAILQ_FIRST(&sa->protos)))
- TAILQ_REMOVE(&sa->protos, proto, link);
+ proto_free(proto);
/*
* Skip to the last transform of this
@@ -2242,8 +2242,7 @@ retry_transform:
*/
while ((proto =
TAILQ_FIRST(&sa->protos)))
- TAILQ_REMOVE(&sa->protos,
- proto, link);
+ proto_free(proto);
goto retry_transform;
}
}
@@ -2270,10 +2269,9 @@ retry_transform:
cleanup:
/*
* Remove potentially succeeded choices from the SA.
- * XXX Do we leak struct protos and related data here?
*/
while ((proto = TAILQ_FIRST(&sa->protos)))
- TAILQ_REMOVE(&sa->protos, proto, link);
+ proto_free(proto);
return -1;
}