Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commiteff751e

Browse files
committed
Robustify tuplesort's free_sort_tuple function
4146925 went to the trouble of removing a theoretical bug fromfree_sort_tuple by checking if the tuple was NULL before freeing it. Let'smake this a little more robust by also setting the tuple to NULL so thatshould we be called again we won't end up doing a pfree on the alreadypfree'd tuple. Per advice from Tom Lane.Discussion:https://postgr.es/m/3188192.1626136953@sss.pgh.pa.usBackpatch-through: 9.6, same as4146925
1 parent187e9c3 commiteff751e

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

‎src/backend/utils/sort/tuplesort.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4588,5 +4588,6 @@ free_sort_tuple(Tuplesortstate *state, SortTuple *stup)
45884588
{
45894589
FREEMEM(state,GetMemoryChunkSpace(stup->tuple));
45904590
pfree(stup->tuple);
4591+
stup->tuple=NULL;
45914592
}
45924593
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp