- Notifications
You must be signed in to change notification settings - Fork4.9k
Commitb7ab88d
committed
Fix assorted new memory leaks in libpq.
Valgrind'ing the postgres_fdw tests showed me that libpq was leakingPGconn.be_cancel_key. It looks like freePGconn is expectingpqDropServerData to release it ... but in a cancel connectionobject, that doesn't happen.Looking a little closer, I was dismayed to find that freePGconnalso missed freeing the pgservice, min_protocol_version,max_protocol_version, sslkeylogfile, scram_client_key_binary,and scram_server_key_binary strings. There's much less excusefor those oversights. Worse, that's from five different commits(a460251,4b99fed,285613c,2da74d8,761c795),some of them by extremely senior hackers.Fortunately, all of these are new in v18, so we haven'tshipped any leaky versions of libpq.While at it, reorder the operations in freePGconn to match theorder of the fields in struct PGconn. Some of those free's seemto have been inserted with the aid of a dartboard.1 parentcb14564 commitb7ab88d
1 file changed
+24
-20
lines changedLines changed: 24 additions & 20 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2027 | 2027 |
| |
2028 | 2028 |
| |
2029 | 2029 |
| |
2030 |
| - | |
2031 | 2030 |
| |
2032 | 2031 |
| |
2033 | 2032 |
| |
2034 | 2033 |
| |
2035 | 2034 |
| |
2036 |
| - | |
2037 | 2035 |
| |
2038 | 2036 |
| |
2039 | 2037 |
| |
| |||
2052 | 2050 |
| |
2053 | 2051 |
| |
2054 | 2052 |
| |
2055 |
| - | |
2056 | 2053 |
| |
2057 | 2054 |
| |
2058 | 2055 |
| |
2059 | 2056 |
| |
2060 | 2057 |
| |
2061 |
| - | |
2062 | 2058 |
| |
2063 | 2059 |
| |
2064 | 2060 |
| |
| |||
5053 | 5049 |
| |
5054 | 5050 |
| |
5055 | 5051 |
| |
5056 |
| - | |
5057 |
| - | |
5058 |
| - | |
5059 |
| - | |
5060 |
| - | |
| 5052 | + | |
5061 | 5053 |
| |
5062 | 5054 |
| |
5063 | 5055 |
| |
5064 | 5056 |
| |
5065 | 5057 |
| |
| 5058 | + | |
5066 | 5059 |
| |
5067 | 5060 |
| |
5068 | 5061 |
| |
5069 | 5062 |
| |
5070 | 5063 |
| |
| 5064 | + | |
5071 | 5065 |
| |
5072 | 5066 |
| |
5073 | 5067 |
| |
| |||
5082 | 5076 |
| |
5083 | 5077 |
| |
5084 | 5078 |
| |
5085 |
| - | |
| 5079 | + | |
5086 | 5080 |
| |
| 5081 | + | |
5087 | 5082 |
| |
5088 | 5083 |
| |
5089 | 5084 |
| |
| |||
5093 | 5088 |
| |
5094 | 5089 |
| |
5095 | 5090 |
| |
5096 |
| - | |
5097 | 5091 |
| |
5098 | 5092 |
| |
5099 |
| - | |
5100 |
| - | |
5101 |
| - | |
5102 | 5093 |
| |
5103 | 5094 |
| |
5104 | 5095 |
| |
5105 | 5096 |
| |
5106 |
| - | |
5107 |
| - | |
5108 |
| - | |
5109 |
| - | |
5110 |
| - | |
5111 |
| - | |
| 5097 | + | |
| 5098 | + | |
| 5099 | + | |
| 5100 | + | |
5112 | 5101 |
| |
| 5102 | + | |
5113 | 5103 |
| |
5114 | 5104 |
| |
5115 | 5105 |
| |
| 5106 | + | |
5116 | 5107 |
| |
5117 | 5108 |
| |
5118 | 5109 |
| |
5119 | 5110 |
| |
5120 | 5111 |
| |
5121 | 5112 |
| |
| 5113 | + | |
| 5114 | + | |
| 5115 | + | |
| 5116 | + | |
| 5117 | + | |
| 5118 | + | |
| 5119 | + | |
| 5120 | + | |
| 5121 | + | |
| 5122 | + | |
| 5123 | + | |
| 5124 | + | |
5122 | 5125 |
| |
5123 | 5126 |
| |
5124 | 5127 |
| |
| |||
5147 | 5150 |
| |
5148 | 5151 |
| |
5149 | 5152 |
| |
| 5153 | + | |
5150 | 5154 |
| |
5151 | 5155 |
| |
5152 | 5156 |
| |
|
0 commit comments
Comments
(0)