summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorJoe Orton <jorton@apache.org>2005-05-18 10:03:37 +0200
committerJoe Orton <jorton@apache.org>2005-05-18 10:03:37 +0200
commit4741d91295d1e0c45ce1b03d4faab23a529c78f1 (patch)
treefb6933f5a721254fe83c0193eb631c1d6c69a3c7 /server
parentWebDAVFS (1.3) is still broken in OS X Tiger. (diff)
downloadapache2-4741d91295d1e0c45ce1b03d4faab23a529c78f1.tar.xz
apache2-4741d91295d1e0c45ce1b03d4faab23a529c78f1.zip
* server/log.c (piped_log_spawn): Don't leak an fd for each
invocation. Reviewed by: Jeff Trawick git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@170719 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/log.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/server/log.c b/server/log.c
index b2d4492582..d8f4fd9811 100644
--- a/server/log.c
+++ b/server/log.c
@@ -820,7 +820,11 @@ static apr_status_t piped_log_spawn(piped_log *pl)
if (status == APR_SUCCESS) {
pl->pid = procnew;
- ap_piped_log_write_fd(pl) = procnew->in;
+ /* procnew->in was dup2'd from ap_piped_log_write_fd(pl);
+ * since the original fd is still valid, close the copy to
+ * avoid a leak. */
+ apr_file_close(procnew->in);
+ procnew->in = NULL;
apr_proc_other_child_register(procnew, piped_log_maintenance, pl,
ap_piped_log_write_fd(pl), pl->p);
close_handle_in_child(pl->p, ap_piped_log_read_fd(pl));