requester: Fix pldmd crash
Add a check to see if the key is exist in the queue of remove request
, to prevent calling the response handler twice after the request has
timed out.
Change-Id: Iafe061d71a6ae7e04a11f462acf00423bd52f4b6
Signed-off-by: SeanCChuang <sean.chuang.wiwynn@gmail.com>
diff --git a/requester/handler.hpp b/requester/handler.hpp
index 465e34f..4bbd170 100644
--- a/requester/handler.hpp
+++ b/requester/handler.hpp
@@ -372,7 +372,7 @@
size_t respMsgLen)
{
RequestKey key{eid, instanceId, type, command};
- if (handlers.contains(key))
+ if (handlers.contains(key) && !removeRequestContainer.contains(key))
{
auto& [request, responseHandler, timerInstance] = handlers[key];
request->stop();