pgsql: Be sure to close() file descriptor on error case

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема pgsql: Be sure to close() file descriptor on error case
Дата
Msg-id E1UyTst-0000HB-Fc@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Be sure to close() file descriptor on error case

In receivelog.c:writeTimeLineHistoryFile(), we were not properly
closing the open'd file descriptor in error cases.  While this
wouldn't matter much if we were about to exit due to such an
error, that's not the case with pg_receivexlog as it can be a
long-running process and these errors are non-fatal.

This resource leak was found by the Coverity scanner.

Back-patch to 9.3 where this issue first appeared.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/cec62efd0e551a56635b47ea4185ec27a6840de7

Modified Files
--------------
src/bin/pg_basebackup/receivelog.c |    2 ++
1 file changed, 2 insertions(+)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: pgsql: Ensure 64bit arithmetic when calculating tapeSpace
Следующее
От: Stephen Frost
Дата:
Сообщение: pgsql: Be sure to close() file descriptor on error case