Skip to content

Commit 59caea0

Browse files
committed
Free list entry memory explicitly on delete
As we delete entry from the list we should also free its memory, even if we later reset whole memory context.
1 parent f75982f commit 59caea0

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

pg_stat_monitor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1594,6 +1594,7 @@ pgsm_delete_entry(uint64 queryid)
15941594
pfree(entry->query_text.query_pointer);
15951595
entry->query_text.query_pointer = NULL;
15961596
lentries = list_delete_last(lentries);
1597+
pfree(entry);
15971598
return;
15981599
}
15991600

@@ -1611,6 +1612,7 @@ pgsm_delete_entry(uint64 queryid)
16111612
pfree(entry->query_text.query_pointer);
16121613
entry->query_text.query_pointer = NULL;
16131614
lentries = list_delete_cell(lentries, lc);
1615+
pfree(entry);
16141616
return;
16151617
}
16161618
}

0 commit comments

Comments
 (0)