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
This commit is contained in:
Mark Johnston 2016-03-02 05:04:04 +00:00
parent f6ed0a3918
commit 3543e138e5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=296303

View File

@ -3490,6 +3490,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)