aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMauro Sardara <msardara@cisco.com>2019-10-31 16:26:54 +0000
committerMauro Sardara <msardara@cisco.com>2019-10-31 16:30:34 +0000
commite043a1223dba07f8103764b91495c0da3aa57a29 (patch)
tree5793aa6eded838fd3be46525d7f32961fd1cfdb6
parent5268f318730bd8f3ffaf62e5d6bfae64eb17cb90 (diff)
[HICN-371] Fix invalid read reported by Valgrind when many timeouts happen.
Signed-off-by: Mauro Sardara <msardara@cisco.com> Change-Id: Ib31e731c02341234169bd5163eb86fe1da900e40 Signed-off-by: Mauro Sardara <msardara@cisco.com>
-rw-r--r--libtransport/src/hicn/transport/core/portal.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/libtransport/src/hicn/transport/core/portal.h b/libtransport/src/hicn/transport/core/portal.h
index b2614d361..4f161e4c8 100644
--- a/libtransport/src/hicn/transport/core/portal.h
+++ b/libtransport/src/hicn/transport/core/portal.h
@@ -451,11 +451,12 @@ class Portal {
if (it != pending_interest_hash_table_.end()) {
PendingInterest::Ptr ptr = std::move(it->second);
pending_interest_hash_table_.erase(it);
+ auto _int = ptr->getInterest();
if (ptr->getOnTimeoutCallback() != UNSET_CALLBACK) {
- ptr->on_interest_timeout_callback_(std::move(ptr->getInterest()));
+ ptr->on_interest_timeout_callback_(std::move(_int));
} else if (consumer_callback_) {
- consumer_callback_->onTimeout(std::move(ptr->getInterest()));
+ consumer_callback_->onTimeout(std::move(_int));
}
}
}