Skip to content

Commit

Permalink
bugfix: __releaseMetadataCacheBlock referenced NULL when multiple cac…
Browse files Browse the repository at this point in the history
…he blocks released.
  • Loading branch information
kaigai committed Jan 20, 2025
1 parent 9d778a8 commit 1882098
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/arrow_fdw.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ arrowFieldGetPGTypeHint(const ArrowField *field)
static void
__releaseMetadataCacheBlock(arrowMetadataCacheBlock *mc_block_curr)
{
if (mc_block_curr)
while (mc_block_curr)
{
arrowMetadataCacheBlock *mc_block_next = mc_block_curr->next;

Expand All @@ -346,14 +346,9 @@ __releaseMetadataCacheBlock(arrowMetadataCacheBlock *mc_block_curr)
!mc_block_curr->chain.prev &&
!mc_block_curr->lru_chain.prev &&
!mc_block_curr->lru_chain.next);

while (mc_block_curr != NULL)
{
dlist_push_head(&arrow_metadata_cache->free_blocks,
&mc_block_curr->chain);
mc_block_curr = mc_block_next;
mc_block_next = mc_block_curr->next;
}
dlist_push_head(&arrow_metadata_cache->free_blocks,
&mc_block_curr->chain);
mc_block_curr = mc_block_next;
}
}

Expand Down

0 comments on commit 1882098

Please sign in to comment.