Skip to content

Commit b089d3e

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 66973b9 commit b089d3e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pg_stat_monitor.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,7 @@ pgsm_delete_entry(uint64 queryid)
16251625
pfree(entry->query_text.query_pointer);
16261626
entry->query_text.query_pointer = NULL;
16271627
lentries = list_delete_last(lentries);
1628+
pfree(entry);
16281629
return;
16291630
}
16301631

@@ -1642,6 +1643,7 @@ pgsm_delete_entry(uint64 queryid)
16421643
pfree(entry->query_text.query_pointer);
16431644
entry->query_text.query_pointer = NULL;
16441645
lentries = list_delete_cell(lentries, lc);
1646+
pfree(entry);
16451647
return;
16461648
}
16471649
}

0 commit comments

Comments
 (0)