Skip to content

Commit

Permalink
Make allocated map to the size of the header
Browse files Browse the repository at this point in the history
  • Loading branch information
marc-gr committed Oct 26, 2021
1 parent d4a83ac commit 8be04d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion x-pack/filebeat/input/httpjson/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func decodeAsCSV(p []byte, dst *response) error {

event, err := r.Read()
for ; err == nil; event, err = r.Read() {
o := map[string]interface{}{}
o := make(map[string]interface{}, len(header))
if len(header) != len(event) {
// sanity check, csv.Reader should fail on this scenario
// and this code path should be unreachable
Expand Down

0 comments on commit 8be04d7

Please sign in to comment.