From e043a1223dba07f8103764b91495c0da3aa57a29 Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Thu, 31 Oct 2019 16:26:54 +0000 Subject: [HICN-371] Fix invalid read reported by Valgrind when many timeouts happen. Signed-off-by: Mauro Sardara Change-Id: Ib31e731c02341234169bd5163eb86fe1da900e40 Signed-off-by: Mauro Sardara --- libtransport/src/hicn/transport/core/portal.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libtransport/src/hicn') 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)); } } } -- cgit 1.2.3-korg