Avoid freeing objects during json aggregate finalization
authorAndrew Dunstan <[email protected]>
Mon, 4 Apr 2022 14:12:30 +0000 (10:12 -0400)
committerAndrew Dunstan <[email protected]>
Mon, 4 Apr 2022 15:03:49 +0000 (11:03 -0400)
commit4eb9798879680dcc0e3ebb301cf6f925dfa69422
treef81d231a7ce429c45d8b5fecf6e87080764dec97
parentafb529e6772b4e2b065644a2204697eeaf6c9a96
Avoid freeing objects during json aggregate finalization

Commit f4fb45d15c tried to free memory during aggregate finalization.
This cause issues, particularly when used as a window function, so stop
doing that.

Per complaint by Jaime Casanova and diagnosis by Andres Freund

Discussion: https://postgr.es/m/YkfeMNYRCGhySKyg@ahch-to
src/backend/utils/adt/json.c