From 9044487e75f54adbba30cf40f28c822513e9db9e Mon Sep 17 00:00:00 2001 From: Iker Luengo Date: Fri, 28 Feb 2020 07:46:35 +0100 Subject: [PATCH] Refs 7530. Protect add_participant_proxy_data on initPDP This is a port of #996 --- src/cpp/rtps/builtin/discovery/participant/PDP.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp index 33a72690e8e..58e92281149 100644 --- a/src/cpp/rtps/builtin/discovery/participant/PDP.cpp +++ b/src/cpp/rtps/builtin/discovery/participant/PDP.cpp @@ -339,7 +339,11 @@ bool PDP::initPDP( } //UPDATE METATRAFFIC. mp_builtin->updateMetatrafficLocators(this->mp_PDPReader->getAttributes().unicastLocatorList); + + mp_mutex->lock(); ParticipantProxyData* pdata = add_participant_proxy_data(part->getGuid(), true); + mp_mutex->unlock(); + if (pdata == nullptr) { return false;