diff options
Diffstat (limited to 'sys/lib/libsa/cread.c')
-rw-r--r-- | sys/lib/libsa/cread.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/lib/libsa/cread.c b/sys/lib/libsa/cread.c index a1445bed320..e8a9c63856f 100644 --- a/sys/lib/libsa/cread.c +++ b/sys/lib/libsa/cread.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cread.c,v 1.12 2004/04/02 04:39:51 deraadt Exp $ */ +/* $OpenBSD: cread.c,v 1.13 2009/01/18 21:46:50 miod Exp $ */ /* $NetBSD: cread.c,v 1.2 1997/02/04 18:38:20 thorpej Exp $ */ /* @@ -250,11 +250,12 @@ close(int fd) return(oclose(fd)); s = ss[fd]; + if (s != NULL) { + inflateEnd(&(s->stream)); - inflateEnd(&(s->stream)); - - free(s->inbuf, Z_BUFSIZE); - free(s, sizeof(struct sd)); + free(s->inbuf, Z_BUFSIZE); + free(s, sizeof(struct sd)); + } return(oclose(fd)); } |