From f467248d2aec62014ff9ae079a79067afcd9e57a Mon Sep 17 00:00:00 2001 From: Wojciech Kosior Date: Tue, 16 Jun 2020 22:37:35 +0200 Subject: close cursor and connection if returning early due to lack of private addresses to use --- src/hourly.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/hourly.py b/src/hourly.py index 95680a5..9563f74 100755 --- a/src/hourly.py +++ b/src/hourly.py @@ -162,7 +162,9 @@ def do_hourly_work(hour): if not subnets: log("couldn't get ANY /30 subnet of private" " addresses from the 0tdns config file - exiting"); - return # TODO close cursor and connection here + cursor.close() + connection.close() + return if len(subnets) < parallel_vpns: log('configuration allows running {0} parallel vpn connections, but' -- cgit v1.2.3