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 committed 2008-10-09 15:53:05 -07:00
1 parent 4d0a329652
commit e4e4a6be82
1 file changed
+1 -1
+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];
}
}