Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e05b5ff

Browse files
committed
bugfix: fixed all the warnings from the clang static analyzer.
1 parent 9d7a1a8 commit e05b5ff

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

src/ngx_http_drizzle_output.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -446,7 +446,7 @@ ngx_http_drizzle_output_field(ngx_http_request_t *r, size_t offset,
446446
}
447447

448448
/* field data */
449-
if (len) {
449+
if (len && field) {
450450
last = ngx_copy(last, field, (uint32_t) len);
451451
}
452452

src/ngx_http_drizzle_upstream.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ ngx_http_upstream_drizzle_free_peer(ngx_peer_connection_t *pc,
883883
ngx_http_drizzle_keepalive_free_peer(pc, dp, dscf, state);
884884
}
885885

886-
if (pc->connection) {
886+
if (pc && pc->connection) {
887887
dd("actually free the drizzle connection");
888888

889889
ngx_http_upstream_drizzle_free_connection(pc->log, pc->connection,

src/ngx_http_drizzle_util.c

-28
Original file line numberDiff line numberDiff line change
@@ -169,34 +169,6 @@ ngx_http_upstream_drizzle_finalize_request(ngx_http_request_t *r,
169169
u->pipe->temp_file->file.fd);
170170
}
171171

172-
#if (NGX_HTTP_CACHE)
173-
174-
if (u->cacheable && r->cache) {
175-
time_t valid;
176-
177-
ngx_log_debug1(NGX_LOG_DEBUG_HTTP, r->connection->log, 0,
178-
"http upstream cache fd: %d",
179-
r->cache->file.fd);
180-
181-
if (rc == NGX_HTTP_BAD_GATEWAY || rc == NGX_HTTP_GATEWAY_TIME_OUT) {
182-
183-
valid = ngx_http_file_cache_valid(u->conf->cache_valid, rc);
184-
185-
if (valid) {
186-
r->cache->valid_sec = ngx_time() + valid;
187-
r->cache->error = rc;
188-
}
189-
}
190-
191-
# if defined(nginx_version) && (nginx_version >= 8047)
192-
ngx_http_file_cache_free(r->cache, u->pipe->temp_file);
193-
# else
194-
ngx_http_file_cache_free(r, u->pipe->temp_file);
195-
# endif
196-
}
197-
198-
#endif
199-
200172
if (u->header_sent
201173
&& (rc == NGX_ERROR || rc >= NGX_HTTP_SPECIAL_RESPONSE))
202174
{

0 commit comments

Comments
 (0)