Make sure all filehandles are closed at the end of a trasaction. See #464 and #465.

Fixes a few typos in some error messages when we are over the limits.
This commit is contained in:
brectanus
2008-03-28 20:00:37 +00:00
parent 8beaef9fd8
commit e13d3dab8b
6 changed files with 33 additions and 7 deletions

View File

@@ -685,6 +685,12 @@ apr_status_t modsecurity_request_body_clear(modsec_rec *msr, char **error_msg) {
log_escape(msr->msc_reqbody_mp, put_filename));
}
} else {
/* make sure it is closed first */
if (msr->msc_reqbody_fd > 0) {
close(msr->msc_reqbody_fd);
msr->msc_reqbody_fd = -1;
}
/* We do not want to keep the request body. */
if (apr_file_remove(msr->msc_reqbody_filename,
msr->msc_reqbody_mp) != APR_SUCCESS)