fallintoplace opened a new pull request, #898:
URL: https://github.com/apache/arrow-go/pull/898
## Summary
### Problem
`CastBinaryToBinaryView` and `CastBinaryViewToBinary` each create a
temporary result array with `ba.bldr.NewArray()`, transfer ownership of its
buffers with `out.TakeOwnership(result.Data())`, and then return without
releasing the temporary array. `TakeOwnership` only transfers buffer ownership,
so the temporary array retains its own reference and can leak memory per cast.
### Change
- Add `defer result.Release()` after creating the temporary result array in:
- `CastBinaryToBinaryView`
- `CastBinaryViewToBinary`
- Keep the existing `TakeOwnership` behavior intact.
### Impact
- Prevents temporary-array retention/leakage in both cast paths.
- No behavior change for successful casts besides corrected memory ownership
semantics.
### Testing
- Behavioral fix only; no additional tests added in this PR.
- New logic is covered by cast ownership patterns exercised by existing cast
test coverage.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]