1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-10 12:58:35 +03:00

param: Fix resource leak

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Joseph Sutton 2023-04-20 09:20:38 +12:00 committed by Andrew Bartlett
parent d497829bf1
commit dd88d7a89f

View File

@ -51,10 +51,10 @@ def iterate_all(path):
"""
try:
p = open(path, 'r')
with open(path, 'r') as p:
out = p.read()
except IOError as e:
raise Exception("Error opening parameters file")
out = p.read()
# parse the parameters xml file
root = ET.fromstring(out)