summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_connection.c
diff options
context:
space:
mode:
authorpaulo <paul@bayleaf.org.uk>2010-01-20 13:09:35 +0000
committerpaulo <paul@bayleaf.org.uk>2010-01-20 13:09:35 +0000
commit13fad04d09978db15317d3d3fb71ab87ea52c110 (patch)
treedca03d21ec9517db4ee837873e6d54736ea20286 /bgpd/bgp_connection.c
parent5b8978176cbefe7c38f3ed72fd863e2e313d86d8 (diff)
downloadquagga-13fad04d09978db15317d3d3fb71ab87ea52c110.tar.bz2
quagga-13fad04d09978db15317d3d3fb71ab87ea52c110.tar.xz
Fix bug in bgp_connection not clearing pointers after free. Planted
asserts to try to track timer crash.
Diffstat (limited to 'bgpd/bgp_connection.c')
-rw-r--r--bgpd/bgp_connection.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/bgpd/bgp_connection.c b/bgpd/bgp_connection.c
index 690b2903..dcfd57e7 100644
--- a/bgpd/bgp_connection.c
+++ b/bgpd/bgp_connection.c
@@ -572,8 +572,16 @@ bgp_connection_close(bgp_connection connection)
bgp_connection_disable_accept(connection) ;
/* forget any addresses */
- sockunion_clear(connection->su_local) ;
- sockunion_clear(connection->su_remote) ;
+ if (connection->su_local != NULL)
+ {
+ sockunion_clear(connection->su_local) ;
+ connection->su_local = NULL;
+ }
+ if (connection->su_remote != NULL)
+ {
+ sockunion_clear(connection->su_remote) ;
+ connection->su_remote = NULL;
+ }
/* Unset all the timers */
qtimer_unset(&connection->hold_timer) ;