diff options
-rwxr-xr-x | client/gentoostats-send | 3 | ||||
-rw-r--r-- | client/gentoostats/utils.py | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/client/gentoostats-send b/client/gentoostats-send index 324b2bc..2ae2857 100755 --- a/client/gentoostats-send +++ b/client/gentoostats-send @@ -72,6 +72,9 @@ def main(): except httplib.HTTPException: sys.stderr.write('Something went wrong') sys.exit(1) + finally: + if conn: + conn.close() if __name__ == "__main__": main() diff --git a/client/gentoostats/utils.py b/client/gentoostats/utils.py index 43a3c73..af807c8 100644 --- a/client/gentoostats/utils.py +++ b/client/gentoostats/utils.py @@ -18,6 +18,9 @@ def GET(server, url, headers, https=True): data = conn.getresponse().read() except httplib.HTTPException: return None + finally: + if conn: + conn.close() return data def deserialize(object): |