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:
Ben Pfaff
2008-10-06 16:25:56 -07:00
parent 4d0a329652
commit e4e4a6be82
+1 -1
View 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];
}
}