Is there any memory leak in Postgres version 12.7 or any other 12.x?
Most likely the answer is no, or if there are the amount is so small as to be practically unmeasurable. It is much more likely that unexpected memory observations results from either having bad expectations, improper configuration and usage patterns for the size system being observed, or both.
The SO stuff you linked to doesn’t seem particularly incriminating in terms of there being a leak.
David J.