diff --git a/src/app-layer-http2.c b/src/app-layer-http2.c index ce0cdc8c2fd0..dd0b3ec53f93 100644 --- a/src/app-layer-http2.c +++ b/src/app-layer-http2.c @@ -91,9 +91,7 @@ void HTTP2MimicHttp1Request(void *alstate_orig, void *h2s) size_t nbheaders = htp_table_size(h1tx->request_headers); for (size_t i = 0; i < nbheaders; i++) { htp_header_t *h = htp_table_get_index(h1tx->request_headers, i, NULL); - if (h != NULL) { - rs_http2_tx_add_header(h2s, bstr_ptr(h->name), bstr_len(h->name), bstr_ptr(h->value), - bstr_len(h->value)); - } + rs_http2_tx_add_header( + h2s, bstr_ptr(h->name), bstr_len(h->name), bstr_ptr(h->value), bstr_len(h->value)); } } diff --git a/src/output-json-http.c b/src/output-json-http.c index 30b33c74527f..5f44e955573d 100644 --- a/src/output-json-http.c +++ b/src/output-json-http.c @@ -321,10 +321,7 @@ static void EveHttpLogJSONHeaders( bool array_empty = true; jb_open_array(js, direction & LOG_HTTP_REQ_HEADERS ? "request_headers" : "response_headers"); for (size_t i = 0; i < n; i++) { - htp_header_t * h = htp_table_get_index(headers, i, NULL); - if (h == NULL) { - continue; - } + htp_header_t *h = htp_table_get_index(headers, i, NULL); if ((http_ctx->flags & direction) == 0 && http_ctx->fields != 0) { bool tolog = false; for (HttpField f = HTTP_FIELD_ACCEPT; f < HTTP_FIELD_SIZE; f++) {