From 8c9b27b9540df0058afa40b4d11d2b00a6ec8df0 Mon Sep 17 00:00:00 2001 From: David Crosby Date: Thu, 9 Jul 2015 21:15:49 -0600 Subject: Fix resource leak in AuthDigestCred --- file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'file.c') 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 { -- cgit v1.2.3 From 7e5b33c30ece6f265593cc442ff5a8579faef8ad Mon Sep 17 00:00:00 2001 From: David Crosby Date: Wed, 15 Jul 2015 08:55:08 -0600 Subject: Remove dead assignments flagged by Clang static analysis --- file.c | 1 - 1 file changed, 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 090a170..098fe00 100644 --- a/file.c +++ b/file.c @@ -7405,7 +7405,6 @@ loadBuffer(URLFile *uf, Buffer *volatile newBuf) if (newBuf == NULL) newBuf = newBuffer(INIT_BUFFER_WIDTH); - lineBuf2 = Strnew(); if (SETJMP(AbortLoading) != 0) { goto _end; -- cgit v1.2.3 From dd9d2a9752b03453dccf09a0f6c9c4bb7f727830 Mon Sep 17 00:00:00 2001 From: David Crosby Date: Tue, 21 Jul 2015 23:05:54 -0600 Subject: Remove unused value --- file.c | 1 - 1 file changed, 1 deletion(-) (limited to 'file.c') diff --git a/file.c b/file.c index 098fe00..4e8e4d3 100644 --- a/file.c +++ b/file.c @@ -7208,7 +7208,6 @@ loadHTMLstream(URLFile *f, Buffer *newBuf, FILE * src, int internal) HTMLlineproc0(lineBuf2->ptr, &htmlenv1, internal); } if (obuf.status != R_ST_NORMAL) { - obuf.status = R_ST_EOL; HTMLlineproc0("\n", &htmlenv1, internal); } obuf.status = R_ST_NORMAL; -- cgit v1.2.3