From fa5098da1ab11daaeba788a2f4106394218b6761 Mon Sep 17 00:00:00 2001 From: Andres Freund Date: Sun, 27 Mar 2016 22:48:31 +0200 Subject: [PATCH] pg_rewind: Close backup_label file descriptor. This was a relatively harmless leak, as createBackupLabel() is only called once per pg_rewind invocation. Author: Michael Paquier Reported-By: Michael Paquier Discussion: CAB7nPqRnOw30gOXe2_SPLjh37bgm4V+txbYAPwoXb97nGQ297w@mail.gmail.com Backpatch: 9.5, where pg_rewind was introduced --- src/bin/pg_rewind/pg_rewind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c index cf5f8487f4b..8e172f16183 100644 --- a/src/bin/pg_rewind/pg_rewind.c +++ b/src/bin/pg_rewind/pg_rewind.c @@ -506,6 +506,7 @@ createBackupLabel(XLogRecPtr startpoint, TimeLineID starttli, XLogRecPtr checkpo /* TODO: move old file out of the way, if any. */ open_target_file("backup_label", true); /* BACKUP_LABEL_FILE */ write_target_range(buf, 0, len); + close_target_file(); } /* -- 2.39.5