Skip to content

Commit a7f6a00

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 a4cc7ea commit a7f6a00

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
@@ -1614,6 +1614,7 @@ pgsm_delete_entry(uint64 queryid)
16141614
pfree(entry->query_text.query_pointer);
16151615
entry->query_text.query_pointer = NULL;
16161616
lentries = list_delete_last(lentries);
1617+
pfree(entry);
16171618
return;
16181619
}
16191620

@@ -1631,6 +1632,7 @@ pgsm_delete_entry(uint64 queryid)
16311632
pfree(entry->query_text.query_pointer);
16321633
entry->query_text.query_pointer = NULL;
16331634
lentries = list_delete_cell(lentries, lc);
1635+
pfree(entry);
16341636
return;
16351637
}
16361638
}

0 commit comments

Comments
 (0)