From 1a7fe0231942d0e57909a2e6458fbcd0d2a5a8e0 Mon Sep 17 00:00:00 2001 From: Markus Friedl Date: Tue, 21 Dec 2010 14:45:58 +0000 Subject: don't leak mbuf if padding failes; ok mikeb@ --- sys/netinet/ip_esp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'sys/netinet/ip_esp.c') diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c index 5a3cfcbe55b..dc3705b3c7c 100644 --- a/sys/netinet/ip_esp.c +++ b/sys/netinet/ip_esp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_esp.c,v 1.114 2010/10/06 22:19:20 mikeb Exp $ */ +/* $OpenBSD: ip_esp.c,v 1.115 2010/12/21 14:45:57 markus Exp $ */ /* * The authors of this code are John Ioannidis (ji@tla.org), * Angelos D. Keromytis (kermit@csd.uch.gr) and @@ -932,6 +932,7 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip, if (mo == NULL) { DPRINTF(("esp_output(): m_inject failed for SA %s/%08x\n", ipsp_address(tdb->tdb_dst), ntohl(tdb->tdb_spi))); + m_freem(m); return ENOBUFS; } pad = mtod(mo, u_char *); -- cgit v1.2.3