summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorclaudio <claudio@openbsd.org>2017-07-19 12:23:16 +0000
committerclaudio <claudio@openbsd.org>2017-07-19 12:23:16 +0000
commita30d926be8e066042ea3e8d3a5715a7998e32f12 (patch)
tree750e09a32c396477672d7ee2a6ba3a94959e0e6d
parentdepend is dead (diff)
downloadwireguard-openbsd-a30d926be8e066042ea3e8d3a5715a7998e32f12.tar.xz
wireguard-openbsd-a30d926be8e066042ea3e8d3a5715a7998e32f12.zip
Fix memory leak in iec_get(). If MCLGET fails free the mbuf as well.
Found by Ilja Van Sprundel OK bluhm@ deraadt@
-rw-r--r--sys/arch/sgi/dev/if_iec.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/arch/sgi/dev/if_iec.c b/sys/arch/sgi/dev/if_iec.c
index 2b590282e59..6408f16b62e 100644
--- a/sys/arch/sgi/dev/if_iec.c
+++ b/sys/arch/sgi/dev/if_iec.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iec.c,v 1.25 2017/02/11 14:40:06 visa Exp $ */
+/* $OpenBSD: if_iec.c,v 1.26 2017/07/19 12:23:16 claudio Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -1155,6 +1155,7 @@ iec_get(struct iec_softc *sc, uint8_t *data, size_t datalen)
printf("%s: unable to allocate RX cluster\n",
sc->sc_dev.dv_xname);
m_freem(head);
+ m_freem(m);
return NULL;
}
len = MCLBYTES;