Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2ef6c66

Browse filesBrowse files
committed
Fix file descriptor leak at end of recovery.
XLogFileInit() returns a file descriptor, which needs to be closed. The leak was short-lived, since the startup process exits shortly afterwards, but it was clearly a bug, nevertheless. Per Coverity report.
1 parent cfb64fd commit 2ef6c66
Copy full SHA for 2ef6c66

File tree

Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed
Filter options
  • src/backend/access/transam
Expand file treeCollapse file tree

1 file changed

+8
-1
lines changed

‎src/backend/access/transam/xlog.c

Copy file name to clipboardExpand all lines: src/backend/access/transam/xlog.c
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5043,8 +5043,15 @@ exitArchiveRecovery(TimeLineID endTLI, XLogRecPtr endOfLog)
50435043
else
50445044
{
50455045
bool use_existent = true;
5046+
int fd;
50465047

5047-
XLogFileInit(startLogSegNo, &use_existent, true);
5048+
fd = XLogFileInit(startLogSegNo, &use_existent, true);
5049+
5050+
if (close(fd))
5051+
ereport(ERROR,
5052+
(errcode_for_file_access(),
5053+
errmsg("could not close log file %s: %m",
5054+
XLogFileNameP(ThisTimeLineID, startLogSegNo))));
50485055
}
50495056

50505057
/*

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.