From: Luke Diamand Date: Thu, 30 Jan 2020 11:50:34 +0000 (+0000) Subject: git-p4: avoid leak of file handle when cloning X-Git-Tag: v2.26.0-rc0~57^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=43f33e492af65d008045ee0695d0f17434e8c3c9;p=thirdparty%2Fgit.git git-p4: avoid leak of file handle when cloning Spotted by Eric Sunshine: https://public-inbox.org/git/CAPig+cRx3hG64nuDie69o_gdX39F=sR6D8LyA7J1rCErgu0aMA@mail.gmail.com/ Signed-off-by: Luke Diamand Signed-off-by: Junio C Hamano --- diff --git a/git-p4.py b/git-p4.py index eb5bc28cf9..9a71a6690d 100755 --- a/git-p4.py +++ b/git-p4.py @@ -3563,7 +3563,8 @@ class P4Sync(Command, P4UserMap): changes = [] if len(self.changesFile) > 0: - output = open(self.changesFile).readlines() + with open(self.changesFile) as f: + output = f.readlines() changeSet = set() for line in output: changeSet.add(int(line))