diff options
Diffstat (limited to 'gdb/serial.c')
-rw-r--r-- | gdb/serial.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/gdb/serial.c b/gdb/serial.c index 0e5a064..005c946 100644 --- a/gdb/serial.c +++ b/gdb/serial.c @@ -116,9 +116,11 @@ serial_close(scb) { last_serial_opened = NULL; - scb->ops->close(scb); - - free(scb); + if (scb != NULL) + { + scb->ops->close(scb); + free(scb); + } } #if 0 |