forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit70bef49
committed
Fix minor memory leaks in pg_dump.
I found these by running pg_dump under "valgrind --leak-check=full".The changes in flagInhIndexes() and getIndexes() replace allocation ofan array of which we use only some elements by individual allocationsof just the actually-needed objects. The previous coding wasted somememory, but more importantly it confused valgrind's leak tracking.collectComments() and collectSecLabels() remain major blots onthe valgrind report, because they don't PQclear their queryresults, in order to avoid a lot of strdup's. That's a dubioustradeoff, but I'll leave it alone here; an upcoming patch willmodify those functions enough to justify changing the tradeoff.1 parentb3b4d8e commit70bef49
3 files changed
+56
-51
lines changedLines changed: 20 additions & 22 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
260 | 260 |
| |
261 | 261 |
| |
262 | 262 |
| |
| 263 | + | |
| 264 | + | |
263 | 265 |
| |
264 | 266 |
| |
265 | 267 |
| |
| |||
373 | 375 |
| |
374 | 376 |
| |
375 | 377 |
| |
376 |
| - | |
377 |
| - | |
| 378 | + | |
378 | 379 |
| |
379 | 380 |
| |
380 | 381 |
| |
381 |
| - | |
382 |
| - | |
383 | 382 |
| |
384 | 383 |
| |
385 | 384 |
| |
386 | 385 |
| |
387 | 386 |
| |
388 |
| - | |
389 |
| - | |
390 |
| - | |
| 387 | + | |
391 | 388 |
| |
392 | 389 |
| |
393 | 390 |
| |
| 391 | + | |
394 | 392 |
| |
395 | 393 |
| |
396 | 394 |
| |
| |||
399 | 397 |
| |
400 | 398 |
| |
401 | 399 |
| |
402 |
| - | |
403 |
| - | |
404 |
| - | |
405 |
| - | |
406 |
| - | |
407 |
| - | |
408 |
| - | |
409 |
| - | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
410 | 410 |
| |
411 | 411 |
| |
412 | 412 |
| |
| |||
423 | 423 |
| |
424 | 424 |
| |
425 | 425 |
| |
426 |
| - | |
427 |
| - | |
428 |
| - | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
429 | 429 |
| |
430 |
| - | |
| 430 | + | |
431 | 431 |
| |
432 | 432 |
| |
433 | 433 |
| |
434 |
| - | |
435 |
| - | |
436 |
| - | |
| 434 | + | |
437 | 435 |
| |
438 | 436 |
| |
439 | 437 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3374 | 3374 |
| |
3375 | 3375 |
| |
3376 | 3376 |
| |
| 3377 | + | |
| 3378 | + | |
3377 | 3379 |
| |
3378 | 3380 |
| |
3379 | 3381 |
| |
|
Lines changed: 34 additions & 29 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6869 | 6869 |
| |
6870 | 6870 |
| |
6871 | 6871 |
| |
6872 |
| - | |
6873 | 6872 |
| |
6874 | 6873 |
| |
6875 | 6874 |
| |
| |||
7133 | 7132 |
| |
7134 | 7133 |
| |
7135 | 7134 |
| |
7136 |
| - | |
7137 | 7135 |
| |
7138 | 7136 |
| |
7139 | 7137 |
| |
| |||
7173 | 7171 |
| |
7174 | 7172 |
| |
7175 | 7173 |
| |
7176 |
| - | |
7177 |
| - | |
7178 |
| - | |
7179 |
| - | |
7180 |
| - | |
7181 |
| - | |
7182 |
| - | |
7183 |
| - | |
7184 |
| - | |
7185 |
| - | |
| 7174 | + | |
| 7175 | + | |
| 7176 | + | |
| 7177 | + | |
| 7178 | + | |
| 7179 | + | |
| 7180 | + | |
| 7181 | + | |
| 7182 | + | |
| 7183 | + | |
| 7184 | + | |
| 7185 | + | |
| 7186 | + | |
7186 | 7187 |
| |
7187 |
| - | |
| 7188 | + | |
7188 | 7189 |
| |
7189 |
| - | |
7190 |
| - | |
7191 |
| - | |
7192 |
| - | |
7193 |
| - | |
7194 |
| - | |
7195 |
| - | |
7196 |
| - | |
7197 |
| - | |
| 7190 | + | |
| 7191 | + | |
| 7192 | + | |
| 7193 | + | |
| 7194 | + | |
| 7195 | + | |
| 7196 | + | |
| 7197 | + | |
| 7198 | + | |
7198 | 7199 |
| |
7199 | 7200 |
| |
7200 | 7201 |
| |
| |||
11878 | 11879 |
| |
11879 | 11880 |
| |
11880 | 11881 |
| |
| 11882 | + | |
11881 | 11883 |
| |
11882 | 11884 |
| |
11883 | 11885 |
| |
| |||
12168 | 12170 |
| |
12169 | 12171 |
| |
12170 | 12172 |
| |
| 12173 | + | |
| 12174 | + | |
| 12175 | + | |
| 12176 | + | |
12171 | 12177 |
| |
12172 | 12178 |
| |
12173 | 12179 |
| |
12174 | 12180 |
| |
12175 | 12181 |
| |
12176 |
| - | |
12177 |
| - | |
12178 |
| - | |
12179 |
| - | |
| 12182 | + | |
| 12183 | + | |
12180 | 12184 |
| |
12181 | 12185 |
| |
12182 | 12186 |
| |
| |||
12329 | 12333 |
| |
12330 | 12334 |
| |
12331 | 12335 |
| |
12332 |
| - | |
12333 |
| - | |
12334 |
| - | |
| 12336 | + | |
12335 | 12337 |
| |
12336 | 12338 |
| |
12337 | 12339 |
| |
| |||
12376 | 12378 |
| |
12377 | 12379 |
| |
12378 | 12380 |
| |
| 12381 | + | |
12379 | 12382 |
| |
12380 | 12383 |
| |
12381 | 12384 |
| |
| |||
14768 | 14771 |
| |
14769 | 14772 |
| |
14770 | 14773 |
| |
| 14774 | + | |
| 14775 | + | |
14771 | 14776 |
| |
14772 | 14777 |
| |
14773 | 14778 |
| |
|
0 commit comments
Comments
(0)