Re: Fix memory leak when output postgres_fdw's "Relations"

2021-07-25 Thread Michael Paquier
On Fri, Jul 23, 2021 at 04:20:37PM -0300, Ranier Vilela wrote: > Maybe not yet. Valgrind may also don't understand yet. I think that you should do things the opposite way. In short, instead of attempting to understand first Valgrind or Coverity and then Postgres, try to understand the internals

Re: Fix memory leak when output postgres_fdw's "Relations"

2021-07-23 Thread Ranier Vilela
Em sex., 23 de jul. de 2021 às 11:32, Tom Lane escreveu: > Ranier Vilela writes: > > This is a minor leak, oversight in > > > https://github.com/postgres/postgres/commit/4526951d564a7eed512b4a0ac3b5893e0a115690#diff-e399f5c029192320f310a79f18c20fb18c8e916fee993237f6f82f05dad851c5 > > I don't

Re: Fix memory leak when output postgres_fdw's "Relations"

2021-07-23 Thread Tom Lane
Ranier Vilela writes: > This is a minor leak, oversight in > https://github.com/postgres/postgres/commit/4526951d564a7eed512b4a0ac3b5893e0a115690#diff-e399f5c029192320f310a79f18c20fb18c8e916fee993237f6f82f05dad851c5 I don't think you understand how Postgres memory management works. There's no

Fix memory leak when output postgres_fdw's "Relations"

2021-07-23 Thread Ranier Vilela
Hi, This is a minor leak, oversight in https://github.com/postgres/postgres/commit/4526951d564a7eed512b4a0ac3b5893e0a115690#diff-e399f5c029192320f310a79f18c20fb18c8e916fee993237f6f82f05dad851c5 ExplainPropertyText does not save the *relations->data* pointer and var relations goes out of scope.