Fix severe memory leaks in GSSAPI encryption support.
authorTom Lane <[email protected]>
Tue, 5 May 2020 17:10:09 +0000 (13:10 -0400)
committerTom Lane <[email protected]>
Tue, 5 May 2020 17:10:17 +0000 (13:10 -0400)
commit46da7bf671c002659d48dad72d325167db8df84b
tree348318b53451931fd1ae4a0e862a4c68dfdf8c21
parentd4329a60d5708382957e61d1036a03929f75c9fc
Fix severe memory leaks in GSSAPI encryption support.

Both the backend and libpq leaked buffers containing encrypted data
to be transmitted, so that the process size would grow roughly as
the total amount of data sent.

There were also far-less-critical leaks of the same sort in GSSAPI
session establishment.

Oversight in commit b0b39f72b, which I failed to notice while
reviewing the code in 2c0cdc818.

Per complaint from pmc@citylink.
Back-patch to v12 where this code was introduced.

Discussion: https://postgr.es/m/20200504115649[email protected]
src/backend/libpq/be-secure-gssapi.c
src/interfaces/libpq/fe-secure-gssapi.c