Fix memory leak that can occur when decoding rtps message with origin authentication being used

Signed-off-by: Dennis Potman <dennis.potman@adlinktech.com>
This commit is contained in:
Dennis Potman 2020-04-15 20:36:05 +02:00 committed by eboasson
parent 680c2ebf8c
commit c89f858b73

View file

@ -3248,7 +3248,10 @@ static bool q_omg_security_decode_rtps_message (struct proxy_participant *proxyp
if (!sc->crypto_context->crypto_transform->decode_rtps_message (sc->crypto_context->crypto_transform, &plain_buffer, &encoded_buffer, pm->pp_crypto_handle, proxypp->sec_attr->crypto_handle, &ex)) if (!sc->crypto_context->crypto_transform->decode_rtps_message (sc->crypto_context->crypto_transform, &plain_buffer, &encoded_buffer, pm->pp_crypto_handle, proxypp->sec_attr->crypto_handle, &ex))
{ {
if (ex.code == DDS_SECURITY_ERR_INVALID_CRYPTO_RECEIVER_SIGN_CODE) if (ex.code == DDS_SECURITY_ERR_INVALID_CRYPTO_RECEIVER_SIGN_CODE)
{
DDS_Security_Exception_reset (&ex);
continue; /* Could be caused by 'with_origin_authentication' being used, so try next match */ continue; /* Could be caused by 'with_origin_authentication' being used, so try next match */
}
GVTRACE ("decoding rtps message from remote participant "PGUIDFMT" failed: %s\n", PGUID (proxypp->e.guid), ex.message ? ex.message : "Unknown error"); GVTRACE ("decoding rtps message from remote participant "PGUIDFMT" failed: %s\n", PGUID (proxypp->e.guid), ex.message ? ex.message : "Unknown error");
DDS_Security_Exception_reset (&ex); DDS_Security_Exception_reset (&ex);
ddsrt_mutex_unlock (&proxypp->sec_attr->lock); ddsrt_mutex_unlock (&proxypp->sec_attr->lock);