diff options
author | Jeff Davis <jdavis@postgresql.org> | 2020-02-18 12:31:24 -0800 |
---|---|---|
committer | Jeff Davis <jdavis@postgresql.org> | 2020-02-19 10:04:17 -0800 |
commit | 8021985d791902a9eeda51acdede759fbc67ae01 (patch) | |
tree | 07b22b50547a244639d0309b515f637bd72c2545 /src/common/jsonapi.c | |
parent | 007491979461ff10d487e1da9bcc87f2fd834f26 (diff) | |
download | postgresql-8021985d791902a9eeda51acdede759fbc67ae01.tar.gz postgresql-8021985d791902a9eeda51acdede759fbc67ae01.zip |
logtape.c: allocate read buffer even for an empty tape.
Prior to this commit, the read buffer was allocated at the time the tape
was rewound; but as an optimization, would not be allocated at all if
the tape was empty.
That optimization meant that it was valid to have a rewound tape with
the buffer set to NULL, but only if a number of conditions were met
and only if the API was used properly. After 7fdd919a refactored the
code to support lazily-allocating the buffer, Coverity started
complaining.
The optimization for empty tapes doesn't seem important, so just
allocate the buffer whether the tape has any data or not.
Discussion: https://postgr.es/m/20351.1581868306%40sss.pgh.pa.us
Diffstat (limited to 'src/common/jsonapi.c')
0 files changed, 0 insertions, 0 deletions