Fix use-after-free error.
[sliver-openvswitch.git] / controller / controller.c
index dcffee4..ff3f8cf 100644 (file)
@@ -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];
                 }
             }