summaryrefslogtreecommitdiff
path: root/sbin/iked/pfkey.c
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2014-05-05 16:13:13 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2014-05-05 16:13:13 +0000
commit46a1313847807f2c813e6d1b6d83d0bbd8a550b0 (patch)
treeeb8ca4d326ca1c3c92759ac25e27c723d4a8b5bf /sbin/iked/pfkey.c
parentd2589c898401515327537ad7bb76857ab3e8bb9e (diff)
don't leak on pid mismatch; ok mikeb
Diffstat (limited to 'sbin/iked/pfkey.c')
-rw-r--r--sbin/iked/pfkey.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sbin/iked/pfkey.c b/sbin/iked/pfkey.c
index a959660cbeb..9cb9703cff1 100644
--- a/sbin/iked/pfkey.c
+++ b/sbin/iked/pfkey.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pfkey.c,v 1.31 2014/05/05 08:23:57 blambert Exp $ */
+/* $OpenBSD: pfkey.c,v 1.32 2014/05/05 16:13:12 markus Exp $ */
/*
* Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org>
@@ -1117,8 +1117,10 @@ pfkey_reply(int sd, u_int8_t **datap, ssize_t *lenp)
/* ignore messages for other processes */
if (hdr.sadb_msg_pid != 0 &&
- hdr.sadb_msg_pid != (u_int32_t)getpid())
+ hdr.sadb_msg_pid != (u_int32_t)getpid()) {
+ free(data);
continue;
+ }
/* not the reply, enqueue */
if ((pm = malloc(sizeof(*pm))) == NULL) {