Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net do not touch region after free



details:   https://anonhg.NetBSD.org/src/rev/03573ec36b05
branches:  trunk
changeset: 500383:03573ec36b05
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Dec 11 07:52:48 2000 +0000

description:
do not touch region after free

diffstat:

 sys/net/route.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (35 lines):

diff -r 6438f8ea8f09 -r 03573ec36b05 sys/net/route.c
--- a/sys/net/route.c   Mon Dec 11 05:41:06 2000 +0000
+++ b/sys/net/route.c   Mon Dec 11 07:52:48 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: route.c,v 1.37 2000/12/09 01:29:45 itojun Exp $        */
+/*     $NetBSD: route.c,v 1.38 2000/12/11 07:52:48 itojun Exp $        */
 
 /*-
  * Copyright (c) 1998 The NetBSD Foundation, Inc.
@@ -757,11 +757,11 @@
        while ((r = LIST_FIRST(&rt->rt_timer)) != NULL) {
                LIST_REMOVE(r, rtt_link);
                TAILQ_REMOVE(&r->rtt_queue->rtq_head, r, rtt_next);
-               pool_put(&rttimer_pool, r);
                if (r->rtt_queue->rtq_count > 0)
                        r->rtt_queue->rtq_count--;
                else
                        printf("rt_timer_remove_all: rtq_count reached 0\n");
+               pool_put(&rttimer_pool, r);
        }
 }
 
@@ -788,11 +788,11 @@
                if (r->rtt_func == func) {
                        LIST_REMOVE(r, rtt_link);
                        TAILQ_REMOVE(&r->rtt_queue->rtq_head, r, rtt_next);
-                       pool_put(&rttimer_pool, r);
                        if (r->rtt_queue->rtq_count > 0)
                                r->rtt_queue->rtq_count--;
                        else
                                printf("rt_timer_add: rtq_count reached 0\n");
+                       pool_put(&rttimer_pool, r);
                        break;  /* only one per list, so we can quit... */
                }
        }



Home | Main Index | Thread Index | Old Index