Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-1-6]: src/sys/net Pull up revision 1.32 (requested by martin in t...
details: https://anonhg.NetBSD.org/src/rev/e754f5e6b6c1
branches: netbsd-1-6
changeset: 530035:e754f5e6b6c1
user: tron <tron%NetBSD.org@localhost>
date: Fri Feb 07 20:07:20 2003 +0000
description:
Pull up revision 1.32 (requested by martin in ticket #1152):
- free buf when unneeded.
- pass a consistent type to free(9).
diffstat:
sys/net/if_pppoe.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diffs (58 lines):
diff -r a96114243ca3 -r e754f5e6b6c1 sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c Fri Feb 07 20:06:26 2003 +0000
+++ b/sys/net/if_pppoe.c Fri Feb 07 20:07:20 2003 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.24.4.7 2003/02/07 20:06:26 tron Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.24.4.8 2003/02/07 20:07:20 tron Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.24.4.7 2003/02/07 20:06:26 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.24.4.8 2003/02/07 20:07:20 tron Exp $");
#include "pppoe.h"
#include "bpfilter.h"
@@ -261,6 +261,12 @@
#endif
sppp_detach(&sc->sc_sppp.pp_if);
if_detach(ifp);
+ if (sc->sc_concentrator_name)
+ free(sc->sc_concentrator_name, M_DEVBUF);
+ if (sc->sc_service_name)
+ free(sc->sc_service_name, M_DEVBUF);
+ if (sc->sc_ac_cookie)
+ free(sc->sc_ac_cookie, M_DEVBUF);
free(sc, M_DEVBUF);
}
@@ -515,6 +521,8 @@
goto done;
}
if (ac_cookie) {
+ if (sc->sc_ac_cookie)
+ free(sc->sc_ac_cookie, M_DEVBUF);
sc->sc_ac_cookie = malloc(ac_cookie_len, M_DEVBUF,
M_DONTWAIT);
if (sc->sc_ac_cookie == NULL)
@@ -556,7 +564,7 @@
sc->sc_state = PPPOE_STATE_INITIAL;
memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest));
if (sc->sc_ac_cookie) {
- free(sc->sc_ac_cookie, M_MBUF);
+ free(sc->sc_ac_cookie, M_DEVBUF);
sc->sc_ac_cookie = NULL;
}
sc->sc_ac_cookie_len = 0;
@@ -993,7 +1001,7 @@
sc->sc_state = PPPOE_STATE_INITIAL;
memcpy(&sc->sc_dest, etherbroadcastaddr, sizeof(sc->sc_dest));
if (sc->sc_ac_cookie) {
- free(sc->sc_ac_cookie, M_MBUF);
+ free(sc->sc_ac_cookie, M_DEVBUF);
sc->sc_ac_cookie = NULL;
}
sc->sc_ac_cookie_len = 0;
Home |
Main Index |
Thread Index |
Old Index