aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/regexp.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2012-11-13 14:44:40 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2012-11-13 14:45:55 -0500
commit68a8ea6046a0583171a34269688a2bcd8d2f8f08 (patch)
treeeb4dfdbbbe496efb6f798fe8140a852086111dd9 /src/backend/utils/adt/regexp.c
parentd0d58f7aa94986edbab6c000470707b90ef37d54 (diff)
downloadpostgresql-68a8ea6046a0583171a34269688a2bcd8d2f8f08.tar.gz
postgresql-68a8ea6046a0583171a34269688a2bcd8d2f8f08.zip
Fix memory leaks in record_out() and record_send().
record_out() leaks memory: it fails to free the strings returned by the per-column output functions, and also is careless about detoasted values. This results in a query-lifespan memory leakage when returning composite values to the client, because printtup() runs the output functions in the query-lifespan memory context. Fix it to handle these issues the same way printtup() does. Also fix a similar leakage in record_send(). (At some point we might want to try to run output functions in shorter-lived memory contexts, so that we don't need a zero-leakage policy for them. But that would be a significantly more invasive patch, which doesn't seem like material for back-patching.) In passing, use appendStringInfoCharMacro instead of appendStringInfoChar in the innermost data-copying loop of record_out, to try to shave a few cycles from this function's runtime. Per trouble report from Carlos Henrique Reimer. Back-patch to all supported versions.
Diffstat (limited to 'src/backend/utils/adt/regexp.c')
0 files changed, 0 insertions, 0 deletions