summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Rees <rees@cvs.openbsd.org>2001-07-16 22:03:39 +0000
committerJim Rees <rees@cvs.openbsd.org>2001-07-16 22:03:39 +0000
commitaeb3beef72c766899fae2129b42b4baff5c78e2f (patch)
tree3cf88ce0d6c83be96075f8fe62336e0b3cf5d8eb
parent217678283d073a57ec407cace389b4e29f2c51f3 (diff)
fix millert's fdset patch (free fdset when done)
-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 */
}