Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit2ef6c66

Browse files
committed
Fix file descriptor leak at end of recovery.
XLogFileInit() returns a file descriptor, which needs to be closed. The leakwas short-lived, since the startup process exits shortly afterwards, but itwas clearly a bug, nevertheless.Per Coverity report.
1 parentcfb64fd commit2ef6c66

File tree

1 file changed

+8
-1
lines changed
  • src/backend/access/transam

1 file changed

+8
-1
lines changed

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

Lines 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
booluse_existent= true;
5046+
intfd;
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)

[8]ページ先頭

©2009-2025 Movatter.jp