[mod_webdav] fix fd leak found with parfait (fixes #2530, thx kukackajiri)

From: Stefan Bühler <stbuehler@web.de>

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2930 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.34
Stefan Bühler 9 years ago
parent 657566828e
commit 24994e113a
  1. 1
      NEWS
  2. 4
      src/mod_webdav.c

@ -16,6 +16,7 @@ NEWS
* [core] decode URL before rewrite, enabling it to work in $HTTP["url"] conditionals (fixes #2526)
* [auto* build] remove -no-undefined from linker flags, as we actually link modules with undefined symbols (fixes #2533)
* [mod_mysql_vhost] fix memory leak on config init (#2530)
* [mod_webdav] fix fd leak found with parfait (fixes #2530, thx kukackajiri)
- 1.4.33 - 2013-09-27
* mod_fastcgi: fix mix up of "mode" => "authorizer" in other fastcgi configs (fixes #2465, thx peex)

@ -1717,7 +1717,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
if (-1 == c->file.fd && /* open the file if not already open */
-1 == (c->file.fd = open(c->file.name->ptr, O_RDONLY))) {
log_error_write(srv, __FILE__, __LINE__, "ss", "open failed: ", strerror(errno));
close(fd);
return HANDLER_ERROR;
}
@ -1726,7 +1726,7 @@ URIHANDLER_FUNC(mod_webdav_subrequest_handler) {
strerror(errno), c->file.name, c->file.fd);
close(c->file.fd);
c->file.fd = -1;
close(fd);
return HANDLER_ERROR;
}

Loading…
Cancel
Save