fix a memory leak

Even after the timer fired, we were retaining a pointer to it;
clean those up too along with the other cleanup tasks.
This commit is contained in:
Shivaram Lingamneni
2019-01-23 01:55:44 -05:00
parent 854d85a474
commit 96737ea6d7
2 changed files with 2 additions and 0 deletions
+1
View File
@@ -158,6 +158,7 @@ func (dm *DLineManager) addNetworkInternal(network net.IPNet, info IPBanInfo) (i
if ok && netBan.Info.TimeCreated.Equal(timeCreated) {
delete(dm.networks, id)
// TODO(slingamn) here's where we'd remove it from the radix tree
delete(dm.expirationTimers, id)
}
}
dm.expirationTimers[id] = time.AfterFunc(timeLeft, processExpiration)