Avoid freeing objects during json aggregate finalization

Andrew Dunstan <andrew@dunslane.net>

Commit: 4eb9798879680dcc0e3ebb301cf6f925dfa69422
Author: Andrew Dunstan <andrew@dunslane.net>
Date: 2022-04-04T15:03:49Z
Releases: 15.0
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

Files

PathChange+/−
src/backend/utils/adt/json.c modified +4 −12

Discussion