Protect against timer exhaustion
Currently there is no check to see if all timers
are used. This adds a check so that under many
connections we don't get a double free.
Tested: Spun up many connections and double free
went away
Change-Id: I7c6914f566064c57ad28d3bfe79a53e44f598a35
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/http/http_connection.h b/http/http_connection.h
index 9f6c7b6..b786175 100644
--- a/http/http_connection.h
+++ b/http/http_connection.h
@@ -864,6 +864,12 @@
close();
});
+
+ if (!timerCancelKey)
+ {
+ close();
+ return;
+ }
BMCWEB_LOG_DEBUG << this << " timer added: " << &timerQueue << ' '
<< *timerCancelKey;
}