From: Ben Pfaff Date: Mon, 6 Oct 2008 23:25:56 +0000 (-0700) Subject: Fix use-after-free error. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e4e4a6be82cf0a4feef45407305b360b405ed57e;p=openvswitch 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.) --- diff --git a/controller/controller.c b/controller/controller.c index dcffee44..ff3f8cf3 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]; } }