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

Commit8ad6a0c

Browse files
committed
Plug memory leak in index_get_partition
The list of indexes was being leaked when asked for an index thatdoesn't have an index partition in the table partition. Not a commoncase admittedly --and in most cases where it occurs, caller throws anerror anyway-- but worth fixing for cleanliness and in case anythird-party code is calling this function.While at it, remove use of lfirst_oid() to obtain a value we alreadyhave.Author: Justin Pryzby <pryzby@telsasoft.com>Reviewed-by: Michael Paquier <michael@paquier.xyz>Discussion:https://postgr.es/m/20201105203606.GF22691@telsasoft.com
1 parent8149e9f commit8ad6a0c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎src/backend/catalog/partition.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,13 +171,14 @@ index_get_partition(Relation partition, Oid indexId)
171171
ReleaseSysCache(tup);
172172
if (!ispartition)
173173
continue;
174-
if (get_partition_parent(lfirst_oid(l))==indexId)
174+
if (get_partition_parent(partIdx)==indexId)
175175
{
176176
list_free(idxlist);
177177
returnpartIdx;
178178
}
179179
}
180180

181+
list_free(idxlist);
181182
returnInvalidOid;
182183
}
183184

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp