aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/common.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-12-07 16:44:58 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-12-07 16:44:58 +0000
commitaaff0a559f84f80c87423a7c565f7e1c5409cb72 (patch)
tree34e7552e68ac91a01300d14bd35c968372b34ced /src/bin/scripts/common.c
parentcac82bb20c618756dcf192c189140a67d95d30ae (diff)
downloadpostgresql-aaff0a559f84f80c87423a7c565f7e1c5409cb72.tar.gz
postgresql-aaff0a559f84f80c87423a7c565f7e1c5409cb72.zip
Clean up a couple of problems in crosstab_hash's use of a hash table.
The original coding leaked memory (at least 8K per crosstab_hash call) because it allowed the hash table to be allocated as a child of TopMemoryContext and then never freed it. Fix that by putting the hash table under per_query_ctx, instead. Also get rid of use of a static variable to point to the hash table. Aside from being ugly, that would actively do the wrong thing in the case of re-entrant calls to crosstab_hash, which are at least theoretically possible since it was expecting the static variable to stay valid across a SPI_execute call.
Diffstat (limited to 'src/bin/scripts/common.c')
0 files changed, 0 insertions, 0 deletions