From: Andres Freund Date: Sun, 27 Mar 2016 20:48:31 +0000 (+0200) Subject: pg_rewind: Close backup_label file descriptor. X-Git-Tag: REL9_6_BETA1~384 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a6c845946dac5c1f26cf8729cf61f1d852f75484;p=thirdparty%2Fpostgresql.git 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 --- diff --git a/src/bin/pg_rewind/pg_rewind.c b/src/bin/pg_rewind/pg_rewind.c index 96a42f8e331..c5589b9bb3a 100644 --- a/src/bin/pg_rewind/pg_rewind.c +++ b/src/bin/pg_rewind/pg_rewind.c @@ -584,6 +584,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(); } /*