zeroshade commented on code in PR #1224:
URL: https://github.com/apache/arrow-go/pull/1224#discussion_r3883456785


##########
arrow/array/concat.go:
##########
@@ -823,13 +803,13 @@ func concatBitmaps(bitmaps []bitmap, mem 
memory.Allocator) (*memory.Buffer, erro
        dst := out.Bytes()
 
        offset := 0
-       for _, bm := range bitmaps {
-               if bm.data == nil { // if the bitmap is nil, that implies that 
the value is true for all elements
-                       bitutil.SetBitsTo(out.Bytes(), int64(offset), 
int64(bm.rng.len), true)
+       for _, d := range data {
+               if buf := d.Buffers()[idx]; buf == nil { // if the bitmap is 
nil, that implies that the value is true for all elements

Review Comment:
   `out` has already been allocated here. If an `ArrayData` implementation 
lacks buffer slot `idx`, this access panics; the outer recovery returns an 
error, but the local buffer is unreachable and leaked. A checked-allocator 
probe retains 64 bytes on this head versus 0 on the base. Please release `out` 
on panic/error after allocation and add a checked-allocator regression test.



-- 
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]

Reply via email to