summaryrefslogtreecommitdiff
path: root/src/mod_compress.c
diff options
context:
space:
mode:
authorJan Kneschke <jan@kneschke.de>2005-10-22 08:10:07 +0000
committerJan Kneschke <jan@kneschke.de>2005-10-22 08:10:07 +0000
commitff29203dbaed2df0e4f01c3c6cc9a8ff25ecde1e (patch)
treec02e2d1ca666092f2f6b7ecf5672694c6bc0d1e8 /src/mod_compress.c
parent396a4de69b49ceca35a3f132227d5c652732ba58 (diff)
downloadlighttpd-git-ff29203dbaed2df0e4f01c3c6cc9a8ff25ecde1e.tar.gz
close fds on error and add CLOEXEC to FDs which stay open for a longer time
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-merge-1.4.x@794 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'src/mod_compress.c')
-rw-r--r--src/mod_compress.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mod_compress.c b/src/mod_compress.c
index def2be6c..6d647565 100644
--- a/src/mod_compress.c
+++ b/src/mod_compress.c
@@ -439,6 +439,9 @@ static int deflate_file_to_file(server *srv, connection *con, plugin_data *p, bu
}
if (-1 == (r = write(ofd, p->b->ptr, p->b->used))) {
+ munmap(start, sce->st.st_size);
+ close(ofd);
+ close(ifd);
return -1;
}