Commit 4c2983c
authored
fix(array): add nil checks in Data.Release() for childData (#456)
### Rationale for this change
My program crashed with below log
```
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x53beb92]
goroutine 294 [running]:
github.com/apache/arrow-go/v18/arrow/array.(*Data).Release(0xc02586a5b0)
/root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/data.go:150 +0x172
github.com/apache/arrow-go/v18/arrow/array.concat.func1()
/root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/concat.go:528 +0x9c
github.com/apache/arrow-go/v18/arrow/array.concat({0xc14ae66008, 0x100, 0x100}, {0x83213c0, 0xb026080})
/root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/concat.go:652 +0x3f7d
github.com/apache/arrow-go/v18/arrow/array.Concatenate({0xc104861908, 0x100, 0x12f}, {0x83213c0, 0xb026080})
/root/go/pkg/mod/github.com/apache/arrow-go/v18@v18.4.0/arrow/array/concat.go:55 +0x585
...
```
### What changes are included in this PR?
Add nil check in Data.Release() for childData to avoid crash.
### Are these changes tested?
Yes.
### Are there any user-facing changes?
No.1 parent 21a20e3 commit 4c2983c
2 files changed
Lines changed: 22 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
136 | 136 | | |
137 | 137 | | |
138 | 138 | | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
0 commit comments