Skip to content

Commit 734d1c9

Browse files
authored
Fix a couple memory leaks caused by files not being closed (#1670)
1 parent a025bca commit 734d1c9

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

Diff for: arduino/security/signatures.go

+1
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ func VerifyArduinoDetachedSignature(targetPath *paths.Path, signaturePath *paths
4242
if err != nil {
4343
panic("could not find bundled signature keys")
4444
}
45+
defer arduinoKeyringFile.Close()
4546
return VerifySignature(targetPath, signaturePath, arduinoKeyringFile)
4647
}
4748

Diff for: i18n/cmd/po/parser.go

+1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func Parse(filename string) MessageCatalog {
3131
}
3232

3333
file, err := os.Open(filename)
34+
defer file.Close()
3435

3536
if err != nil {
3637
fmt.Println(err.Error())

0 commit comments

Comments
 (0)