aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshemminger <shemminger>2003-05-09 18:42:03 +0000
committershemminger <shemminger>2003-05-09 18:42:03 +0000
commit294ee034008c7db57053ebdd4be11cc81c4e511b (patch)
treeeb4801cbb8de04d58ff2a25b9fa6a67c06ec55c6
parent284d907d6da3bd1cfca0bbc64a47f18cb56191dd (diff)
downloadbridge-utils-294ee034008c7db57053ebdd4be11cc81c4e511b.tar.gz
From: John Naylon <jbpn@cambridgebroadband.com>
Please find attached a patch which fixes a minor bug in libbridge. This only affects long-running processes that may call br_refresh() multiple times, i.e. it doesn't affect brctl but may affect brctld, although I have not seen this myself (I discovered the bug while working on another process that links against libbridge). Basically, if you call br_refresh() when there are one or more bridges up, take all bridges down and call br_refresh() again, and finally call br_refresh() once more, your process will probably seg fault because bridge_list is not NULL, but points at previously-free()d memory on the third call.
-rw-r--r--libbridge/libbridge_init.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libbridge/libbridge_init.c b/libbridge/libbridge_init.c
index d4a1464..e7bb918 100644
--- a/libbridge/libbridge_init.c
+++ b/libbridge/libbridge_init.c
@@ -211,6 +211,7 @@ int br_refresh()
br_nuke_bridge(b);
b = bnext;
}
+ bridge_list = NULL;
return br_make_bridge_list();
}