Commit 623661e
committed
Pass correct pointer to cleanup in ensure_vector_match error path
When the second vector fails to parse in ensure_vector_match(), the cleanup function for the first vector was called with 'a' (void**) instead of '*a' (void*). This caused sqlite3_free to be called with a stack address instead of the heap-allocated vector, resulting in a crash:
malloc: Non-aligned pointer being freed
Fatal error 6: Aborted
The fix dereferences the pointer correctly, matching how cleanup is
done in other error paths.
This fix has a unit test that will crash without the patch.1 parent 9facf1a commit 623661e
2 files changed
+27
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1137 | 1137 | | |
1138 | 1138 | | |
1139 | 1139 | | |
1140 | | - | |
| 1140 | + | |
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
446 | 472 | | |
447 | 473 | | |
448 | 474 | | |
| |||
0 commit comments