Fix potential attach order bug when attaching a serial port to a single line mux found by Dave Bryan

This commit is contained in:
Mark Pizzolato 2012-12-29 06:26:47 -08:00
parent 30c70f6866
commit 122ca9b7cd

View file

@ -1641,7 +1641,7 @@ while (*tptr) {
serport = sim_open_serial (destination, lp, &r);
if (serport != INVALID_HANDLE) {
_mux_detach_line (lp, TRUE, TRUE);
if (lp->mp->master) { /* if existing listener, close it */
if (lp->mp && lp->mp->master) { /* if existing listener, close it */
sim_close_sock (lp->mp->master, 1);
lp->mp->master = 0;
free (lp->mp->port);