forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit4b65269
committed
Fix memory leaks from incorrect strsep() uses
Commit5d2e1cc introduced some strsep() uses, but it did thememory management wrong in some cases. We need to keep a separatepointer to the allocate memory so that we can free it later, becausestrsep() advances the pointer we pass to it, and it at the end itwill be NULL, so any free() calls won't do anything.(This fixes two of the four places changed in commit5d2e1cc. Theother two don't have this problem.)Reported-by: Alexander Lakhin <exclusion@gmail.com>Discussion:https://www.postgresql.org/message-id/flat/79692bf9-17d3-41e6-b9c9-fc8c3944222a@eisentraut.org1 parent24a36f9 commit4b65269
2 files changed
+7
-3
lines changedLines changed: 2 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
120 | 120 |
| |
121 | 121 |
| |
122 | 122 |
| |
| 123 | + | |
123 | 124 |
| |
124 |
| - | |
| 125 | + | |
125 | 126 |
| |
126 | 127 |
| |
127 | 128 |
| |
|
Lines changed: 5 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
233 | 233 |
| |
234 | 234 |
| |
235 | 235 |
| |
236 |
| - | |
237 | 236 |
| |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
238 | 241 |
| |
239 | 242 |
| |
240 | 243 |
| |
241 | 244 |
| |
242 | 245 |
| |
243 |
| - | |
| 246 | + | |
244 | 247 |
| |
245 | 248 |
| |
246 | 249 |
| |
|
0 commit comments
Comments
(0)