Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/net - free buf when unneeded.
details: https://anonhg.NetBSD.org/src/rev/d55598e0e477
branches: trunk
changeset: 533149:d55598e0e477
user: yamt <yamt%NetBSD.org@localhost>
date: Sat Jun 22 17:41:23 2002 +0000
description:
- 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 07f28ae9c190 -r d55598e0e477 sys/net/if_pppoe.c
--- a/sys/net/if_pppoe.c Sat Jun 22 16:56:11 2002 +0000
+++ b/sys/net/if_pppoe.c Sat Jun 22 17:41:23 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_pppoe.c,v 1.31 2002/06/22 16:56:11 yamt Exp $ */
+/* $NetBSD: if_pppoe.c,v 1.32 2002/06/22 17:41:23 yamt 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.31 2002/06/22 16:56:11 yamt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_pppoe.c,v 1.32 2002/06/22 17:41:23 yamt 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