forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit8021985
committed
logtape.c: allocate read buffer even for an empty tape.
Prior to this commit, the read buffer was allocated at the time the tapewas rewound; but as an optimization, would not be allocated at all ifthe tape was empty.That optimization meant that it was valid to have a rewound tape withthe buffer set to NULL, but only if a number of conditions were metand only if the API was used properly. After7fdd919 refactored thecode to support lazily-allocating the buffer, Coverity startedcomplaining.The optimization for empty tapes doesn't seem important, so justallocate the buffer whether the tape has any data or not.Discussion:https://postgr.es/m/20351.1581868306%40sss.pgh.pa.us1 parent0074919 commit8021985
1 file changed
+5
-11
lines changedLines changed: 5 additions & 11 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
544 | 544 |
| |
545 | 545 |
| |
546 | 546 |
| |
547 |
| - | |
548 |
| - | |
549 |
| - | |
550 |
| - | |
551 |
| - | |
| 547 | + | |
| 548 | + | |
552 | 549 |
| |
553 | 550 |
| |
554 | 551 |
| |
| |||
839 | 836 |
| |
840 | 837 |
| |
841 | 838 |
| |
| 839 | + | |
| 840 | + | |
842 | 841 |
| |
843 |
| - | |
844 |
| - | |
845 |
| - | |
846 |
| - | |
847 |
| - | |
848 |
| - | |
| 842 | + | |
849 | 843 |
| |
850 | 844 |
| |
851 | 845 |
| |
|
0 commit comments
Comments
(0)