summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpat <pat@openbsd.org>2004-11-29 20:15:40 +0000
committerpat <pat@openbsd.org>2004-11-29 20:15:40 +0000
commitc7b46a35e0ba3fe777cc33ada140859f93f88646 (patch)
treeac163c7466005b5663d8ab190115f0d824a8283d
parentsync (diff)
downloadwireguard-openbsd-c7b46a35e0ba3fe777cc33ada140859f93f88646.tar.xz
wireguard-openbsd-c7b46a35e0ba3fe777cc33ada140859f93f88646.zip
plug memory leaks on error
ok canacar markus millert
-rw-r--r--sys/arch/i386/isa/isa_machdep.c4
-rw-r--r--sys/net/if_pppoe.c9
2 files changed, 9 insertions, 4 deletions
diff --git a/sys/arch/i386/isa/isa_machdep.c b/sys/arch/i386/isa/isa_machdep.c
index 1346d76882a..5581d4848d5 100644
--- a/sys/arch/i386/isa/isa_machdep.c
+++ b/sys/arch/i386/isa/isa_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: isa_machdep.c,v 1.50 2004/06/28 01:41:53 aaron Exp $ */
+/* $OpenBSD: isa_machdep.c,v 1.51 2004/11/29 20:15:40 pat Exp $ */
/* $NetBSD: isa_machdep.c,v 1.22 1997/06/12 23:57:32 thorpej Exp $ */
#define ISA_DMA_STATS
@@ -575,6 +575,7 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what)
if (!LEGAL_IRQ(irq) || type == IST_NONE) {
printf("%s: isa_intr_establish: bogus irq or type\n", ih_what);
+ free(ih, M_DEVBUF);
return (NULL);
}
switch (intrtype[irq]) {
@@ -590,6 +591,7 @@ isa_intr_establish(ic, irq, type, level, ih_fun, ih_arg, ih_what)
/*printf("%s: intr_establish: can't share %s with %s, irq %d\n",
ih_what, isa_intr_typename(intrtype[irq]),
isa_intr_typename(type), irq);*/
+ free(ih, M_DEVBUF);
return (NULL);
}
break;
diff --git a/sys/net/if_pppoe.c b/sys/net/if_pppoe.c
index 3d4583eeea9..1c541608c16 100644
--- a/sys/net/if_pppoe.c
+++ b/sys/net/if_pppoe.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_pppoe.c,v 1.1 2004/11/28 23:39:45 canacar Exp $ */
+/* $OpenBSD: if_pppoe.c,v 1.2 2004/11/29 20:15:40 pat Exp $ */
/* $NetBSD: if_pppoe.c,v 1.51 2003/11/28 08:56:48 keihan Exp $ */
/*
@@ -809,12 +809,15 @@ pppoe_output(struct pppoe_softc *sc, struct mbuf *m)
u_int16_t etype;
if (sc->sc_eth_if == NULL) {
- m_free(m);
+ m_freem(m);
return (EIO);
}
- if ((sc->sc_eth_if->if_flags & (IFF_UP|IFF_RUNNING)) != (IFF_UP|IFF_RUNNING))
+ if ((sc->sc_eth_if->if_flags & (IFF_UP|IFF_RUNNING))
+ != (IFF_UP|IFF_RUNNING)) {
+ m_freem(m);
return (ENETDOWN);
+ }
memset(&dst, 0, sizeof dst);
dst.sa_family = AF_UNSPEC;