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

Commita92709f

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 parenta3b8d91 commita92709f

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
@@ -4777,5 +4777,6 @@ free_sort_tuple(Tuplesortstate *state, SortTuple *stup)
47774777
{
47784778
FREEMEM(state,GetMemoryChunkSpace(stup->tuple));
47794779
pfree(stup->tuple);
4780+
stup->tuple=NULL;
47804781
}
47814782
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp