Skip to content

Commit

Permalink
rib: Fix memory leak in rib.
Browse files Browse the repository at this point in the history
This probably only happens on teardown..found with valgrind.

Signed-off-by: Ben Greear <greearb@candelatech.com>
  • Loading branch information
greearb committed Sep 20, 2011
1 parent 2a15d7b commit 0f1a000
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 0 additions & 1 deletion xorp/rib/protocol.hh
Expand Up @@ -17,7 +17,6 @@
// XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/rib/protocol.hh,v 1.14 2008/10/02 21:58:11 bms Exp $

#ifndef __RIB_PROTOCOL_HH__
#define __RIB_PROTOCOL_HH__
Expand Down
7 changes: 7 additions & 0 deletions xorp/rib/rib.cc
Expand Up @@ -294,10 +294,17 @@ RIB<A>::~RIB()
delete _tables.front();
_tables.pop_front();
}

while (! _protocols.empty()) {
delete _protocols.begin()->second;
_protocols.erase(_protocols.begin());
}

while (_vifs.empty() == false) {
delete _vifs.begin()->second;
_vifs.erase(_vifs.begin());
}

while (_deleted_vifs.empty() == false) {
delete _deleted_vifs.begin()->second;
_deleted_vifs.erase(_deleted_vifs.begin());
Expand Down
1 change: 0 additions & 1 deletion xorp/rib/rib.hh
Expand Up @@ -18,7 +18,6 @@
// XORP Inc, 2953 Bunker Hill Lane, Suite 204, Santa Clara, CA 95054, USA;
// http://xorp.net

// $XORP: xorp/rib/rib.hh,v 1.44 2008/10/02 21:58:11 bms Exp $

#ifndef __RIB_RIB_HH__
#define __RIB_RIB_HH__
Expand Down

0 comments on commit 0f1a000

Please sign in to comment.