libnetwork: fix some unclosed file-handles in tests

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn 2022-06-01 10:56:03 +02:00
parent c482383458
commit 1090aaaedd
No known key found for this signature in database
GPG key ID: 76698F39D527CE8C

View file

@ -44,9 +44,11 @@ func newKey(t *testing.T) (string, error) {
}
name = filepath.Join("/tmp", name)
if _, err := os.Create(name); err != nil {
f, err := os.Create(name)
if err != nil {
return "", err
}
_ = f.Close()
// Set the rpmCleanupPeriod to be low to make the test run quicker
gpmLock.Lock()