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

Commitfe228ac

Browse files
Alena Rybakinadanolivo
Alena Rybakina
authored andcommitted
Avoid memory leak on deletion from uint64 list
1 parentfa9c962 commitfe228ac

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎hash.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ get_grouped_exprs_hash(int child_fss, List *group_exprs)
176176

177177
final_hashes[0]=child_fss;
178178
final_hashes[1]=get_int_array_hash(hashes,i);
179+
180+
pfree(hashes);
181+
179182
returnget_int_array_hash(final_hashes,2);
180183
}
181184

@@ -475,6 +478,7 @@ get_relations_hash(List *relsigns)
475478
intnhashes=0;
476479
int64*hashes=palloc(list_length(relsigns)*sizeof(uint64));
477480
ListCell*lc;
481+
int64result;
478482

479483
foreach(lc,relsigns)
480484
{
@@ -485,8 +489,12 @@ get_relations_hash(List *relsigns)
485489
qsort(hashes,nhashes,sizeof(int64),int64_compare);
486490

487491
/* Make a final hash value */
488-
returnDatumGetInt64(hash_any_extended((constunsignedchar*)hashes,
492+
493+
result=DatumGetInt64(hash_any_extended((constunsignedchar*)hashes,
489494
nhashes*sizeof(int64),0));
495+
496+
pfree(hashes);
497+
returnresult;
490498
}
491499

492500
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp