summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libsectok/scio.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libsectok/scio.c b/lib/libsectok/scio.c
index 2c1265bf00e..b6c7731e74e 100644
--- a/lib/libsectok/scio.c
+++ b/lib/libsectok/scio.c
@@ -1,4 +1,4 @@
-/* $Id: scio.c,v 1.6 2001/07/16 22:01:22 rees Exp $ */
+/* $Id: scio.c,v 1.7 2001/07/16 22:03:38 rees Exp $ */
/*
copyright 1997
@@ -395,15 +395,20 @@ scgetc(int ttyn, unsigned char *cp, int ms)
tvp = &tv;
}
- if (select(fd + 1, fdset, NULL, NULL, tvp) != 1)
+ if (select(fd + 1, fdset, NULL, NULL, tvp) != 1) {
+ free(fdset);
return SCTIMEO;
+ }
- if (read(fd, cp, 1) != 1)
+ if (read(fd, cp, 1) != 1) {
+ free(fdset);
return SCTIMEO;
+ }
if (sc[ttyn].flags & SCOINVRT)
*cp = todos_scinvert[*cp];
+ free(fdset);
return SCEOK; /* 0 */
}