summaryrefslogtreecommitdiffstats
path: root/serial.c
diff options
context:
space:
mode:
Diffstat (limited to 'serial.c')
-rw-r--r--serial.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/serial.c b/serial.c
index 5cc2fe0..b504974 100644
--- a/serial.c
+++ b/serial.c
@@ -110,6 +110,8 @@ fdtype sp_openserport(char *dev, unsigned int baud)
(tolower((unsigned char)dev[1]) == 'o') &&
(tolower((unsigned char)dev[2]) == 'm')) {
dev2 = malloc(strlen(dev) + 5);
+ if (!dev2)
+ sp_die("Error: Out of memory");
strcpy(dev2, "\\\\.\\");
strcpy(dev2 + 4, dev);
}
OpenPOWER on IntegriCloud