From 122ca9b7cddf75a5d37623c64261d1929b64e6e4 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 29 Dec 2012 06:26:47 -0800 Subject: [PATCH] Fix potential attach order bug when attaching a serial port to a single line mux found by Dave Bryan --- sim_tmxr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sim_tmxr.c b/sim_tmxr.c index 966bfd84..36093e47 100644 --- a/sim_tmxr.c +++ b/sim_tmxr.c @@ -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);