Skip to content

Commit

Permalink
Merge pull request #553 from danielgtaylor/fix-pool-reset-order
Browse files Browse the repository at this point in the history
fix: order of operations when resetting buffer
  • Loading branch information
danielgtaylor committed Aug 20, 2024
2 parents e1ffc73 + 731da9e commit 77c7a16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion huma.go
Original file line number Diff line number Diff line change
Expand Up @@ -1299,8 +1299,8 @@ func Register[I, O any](api API, op Operation, handler func(context.Context, *I)
// No raw body, and the body has already been unmarshalled above, so
// we can return the buffer to the pool now as we don't need the
// bytes any more.
bufPool.Put(buf)
buf.Reset()
bufPool.Put(buf)
}
}
}
Expand Down

0 comments on commit 77c7a16

Please sign in to comment.