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.)
This commit is contained in:
@@ -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];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user