Skip to content

Commit

Permalink
ptrace: json unmarshaller use defer
Browse files Browse the repository at this point in the history
  • Loading branch information
hanjm committed Apr 27, 2022
1 parent f954620 commit d68f650
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pdata/ptrace/jsoniter.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ func newJSONIterUnmarshaler() *jsonIterUnmarshaler {

func (d *jsonIterUnmarshaler) UnmarshalTraces(buf []byte) (Traces, error) {
iter := jsoniter.ConfigFastest.BorrowIterator(buf)
defer jsoniter.ConfigFastest.ReturnIterator(iter)
td := readTraceData(iter)
err := iter.Error
jsoniter.ConfigFastest.ReturnIterator(iter)
return internal.TracesFromProto(td), err
}

Expand Down

0 comments on commit d68f650

Please sign in to comment.