From 65ac9b0711760d8eff67cc236ab416dd19b2c92c Mon Sep 17 00:00:00 2001 From: Erik Boasson Date: Wed, 2 Jan 2019 11:38:07 +0100 Subject: [PATCH] fix error propagation in dds_get_qos Signed-off-by: Erik Boasson --- src/core/ddsc/src/dds_entity.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/core/ddsc/src/dds_entity.c b/src/core/ddsc/src/dds_entity.c index ff28b92..72fe706 100644 --- a/src/core/ddsc/src/dds_entity.c +++ b/src/core/ddsc/src/dds_entity.c @@ -560,7 +560,7 @@ dds_get_qos( { dds_entity *e; dds__retcode_t rc; - dds_return_t ret = DDS_RETCODE_OK; + dds_return_t ret; if (qos == NULL) { DDS_ERROR("Argument qos is NULL\n"); @@ -574,11 +574,10 @@ dds_get_qos( goto fail; } if (e->m_deriver.set_qos) { - rc = dds_copy_qos(qos, e->m_qos); + ret = dds_copy_qos(qos, e->m_qos); } else { - rc = DDS_RETCODE_ILLEGAL_OPERATION; DDS_ERROR("QoS cannot be set on this entity\n"); - ret = DDS_ERRNO(rc); + ret = DDS_ERRNO(DDS_RETCODE_ILLEGAL_OPERATION); } dds_entity_unlock(e); fail: