aboutsummaryrefslogtreecommitdiffstats
path: root/file.c
diff options
context:
space:
mode:
authorDavid Crosby <dave@dafyddcrosby.com>2015-07-10 03:15:49 +0000
committerTatsuya Kinoshita <tats@debian.org>2015-08-11 12:59:27 +0000
commit8c9b27b9540df0058afa40b4d11d2b00a6ec8df0 (patch)
tree44a8213fae154656739cb9cbac67ef7a6820127a /file.c
parentFix resource leak in readBufferCache (diff)
downloadw3m-8c9b27b9540df0058afa40b4d11d2b00a6ec8df0.tar.gz
w3m-8c9b27b9540df0058afa40b4d11d2b00a6ec8df0.zip
Fix resource leak in AuthDigestCred
Diffstat (limited to 'file.c')
-rw-r--r--file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/file.c b/file.c
index df865a0..090a170 100644
--- a/file.c
+++ b/file.c
@@ -1228,6 +1228,7 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
unsigned char md5[MD5_DIGEST_LENGTH + 1];
Str uri = HTTPrequestURI(pu, hr);
char nc[] = "00000001";
+ FILE *fp;
Str algorithm = qstr_unquote(get_auth_param(ha->param, "algorithm"));
Str nonce = qstr_unquote(get_auth_param(ha->param, "nonce"));
@@ -1310,10 +1311,11 @@ AuthDigestCred(struct http_auth *ha, Str uname, Str pw, ParsedURL *pu,
/* A2 = Method ":" digest-uri-value ":" H(entity-body) */
if (request && request->body) {
if (request->method == FORM_METHOD_POST && request->enctype == FORM_ENCTYPE_MULTIPART) {
- FILE *fp = fopen(request->body, "r");
+ fp = fopen(request->body, "r");
if (fp != NULL) {
Str ebody;
ebody = Strfgetall(fp);
+ fclose(fp);
MD5(ebody->ptr, strlen(ebody->ptr), md5);
}
else {