Commit 229b480
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 06078bd commit 229b480
2 files changed
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6338 | 6338 | | |
6339 | 6339 | | |
6340 | 6340 | | |
| 6341 | + | |
| 6342 | + | |
| 6343 | + | |
| 6344 | + | |
| 6345 | + | |
| 6346 | + | |
6341 | 6347 | | |
6342 | 6348 | | |
6343 | 6349 | | |
| |||
| 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