summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuiz Otavio O Souza <luiz@netgate.com>2016-05-11 13:16:31 -0500
committerLuiz Otavio O Souza <luiz@netgate.com>2016-05-12 11:01:23 -0500
commitebf6680ee900f85ebe4e6493cfd7257809fded01 (patch)
treebbe82011ddfe9c9c3016d59e6d700d0ddc07b211
parent79f295f7fdbf10f912085b0aed22d81f465a1d68 (diff)
downloadFreeBSD-src-ebf6680ee900f85ebe4e6493cfd7257809fded01.zip
FreeBSD-src-ebf6680ee900f85ebe4e6493cfd7257809fded01.tar.gz
MFC r296303:
Set tres to NULL to avoid a double free if the m_pullup() below fails. Reviewed by: glebius MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D5497 TAG: IPSEC-HEAD (cherry picked from commit b2f9e794c95db742bed25781e3287d5f53111edb)
-rw-r--r--sys/netipsec/key.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/netipsec/key.c b/sys/netipsec/key.c
index fa798c4..f875c39 100644
--- a/sys/netipsec/key.c
+++ b/sys/netipsec/key.c
@@ -3486,6 +3486,7 @@ key_setdumpsa(struct secasvar *sav, u_int8_t type, u_int8_t satype,
}
m_cat(result, tres);
+ tres = NULL;
if (result->m_len < sizeof(struct sadb_msg)) {
result = m_pullup(result, sizeof(struct sadb_msg));
if (result == NULL)
OpenPOWER on IntegriCloud