]> granicus.if.org Git - apache/commitdiff
fix potential file descriptor leak with DEBUG_CGI
authorStefan Fritsch <sf@apache.org>
Mon, 5 Apr 2010 20:36:23 +0000 (20:36 +0000)
committerStefan Fritsch <sf@apache.org>
Mon, 5 Apr 2010 20:36:23 +0000 (20:36 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@930955 13f79535-47bb-0310-9956-ffa450edef68

modules/generators/mod_cgi.c

index ce50608243de4e78b69c0ffcda62e764090fbc13..0d000b9b44d8cbb76e0f41698d7ebe68faa86976 100644 (file)
@@ -411,6 +411,7 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
     fprintf(dbg, "Environment: \n");
     for (i = 0; env[i]; ++i)
         fprintf(dbg, "'%s'\n", env[i]);
+    fclose(dbg);
 #endif
 
     /* Transmute ourselves into the script.
@@ -480,9 +481,6 @@ static apr_status_t run_cgi_child(apr_file_t **script_out,
             }
         }
     }
-#ifdef DEBUG_CGI
-    fclose(dbg);
-#endif
     return (rc);
 }