Commit 4d07452
authored
SetTopTransactionName() stores the transaction name in TopTransactionContext
memory. When the transaction ends, this memory is freed but the name pointer
is not set to NULL, leaving a dangling pointer. A subsequent call to
IsTopTransactionName() then reads freed memory via strcmp().
Introduce ResetTopTransactionName() which NULLs out name. This is called from
pltsql_xact_cb to ensure the pointer is reset on every transaction end.
Extension PR: babelfish-for-postgresql/babelfish_extensions#4717
Task: BABEL-5245
Authored-by: Rucha Kulkarni ruchask@amazon.com
1 parent 3e5ec3e commit 4d07452
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6453 | 6453 | | |
6454 | 6454 | | |
6455 | 6455 | | |
| 6456 | + | |
| 6457 | + | |
| 6458 | + | |
| 6459 | + | |
| 6460 | + | |
| 6461 | + | |
6456 | 6462 | | |
6457 | 6463 | | |
6458 | 6464 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
| 532 | + | |
532 | 533 | | |
533 | 534 | | |
534 | 535 | | |
| |||
0 commit comments