From f41240e6f32f1162132d4f307e95e4d452e24a0f Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 31 Mar 2011 14:11:57 -0700 Subject: [PATCH] ofproto: Fix order of destruction in ofproto_destroy(). ofproto_flush_flows() calls into the connmgr (via connmgr_flushed()) so it must be called before destroying the connmgr to avoid a use-after-free error. Bug #5231. Reported-by: Krishna Miriyala --- ofproto/ofproto.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 6994b117..7cdc98ad 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -683,10 +683,8 @@ ofproto_destroy(struct ofproto *p) shash_find_and_delete(&all_ofprotos, dpif_name(p->dpif)); - /* Destroy connmgr early, since it touches the classifier. */ - connmgr_destroy(p->connmgr); - ofproto_flush_flows(p); + connmgr_destroy(p->connmgr); classifier_destroy(&p->cls); hmap_destroy(&p->facets); -- 2.30.2