From e4e4a6be82cf0a4feef45407305b360b405ed57e Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Mon, 6 Oct 2008 16:25:56 -0700 Subject: [PATCH] Fix use-after-free error. rconn_destroy() decrements the n_queued counters that are set up by rconn_send(), so we need to destroy the rconn before we destroy anything that used it. (This system is more error-prone than I imagined.) --- controller/controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controller/controller.c b/controller/controller.c index dcffee44e..ff3f8cf3a 100644 --- a/controller/controller.c +++ b/controller/controller.c @@ -174,8 +174,8 @@ main(int argc, char *argv[]) } i++; } else { - lswitch_destroy(this->lswitch); rconn_destroy(this->rconn); + lswitch_destroy(this->lswitch); switches[i] = switches[--n_switches]; } } -- 2.45.2