diff --git a/src/iec61850/client/client_report_control.c b/src/iec61850/client/client_report_control.c index 390863e4..085e4a75 100644 --- a/src/iec61850/client/client_report_control.c +++ b/src/iec61850/client/client_report_control.c @@ -698,11 +698,22 @@ IedConnection_getRCBValues(IedConnection self, IedClientError* error, const char if (returnRcb == NULL) returnRcb = ClientReportControlBlock_create(rcbReference); - clientReportControlBlock_updateValues(returnRcb, rcb); + if (clientReportControlBlock_updateValues(returnRcb, rcb)) { + *error = IED_ERROR_OK; + } + else { + if (DEBUG_IED_CLIENT) + printf("DEBUG_IED_CLIENT: getRCBValues returned wrong type!\n"); - MmsValue_delete(rcb); + *error = IED_ERROR_TYPE_INCONSISTENT; - *error = IED_ERROR_OK; + if (updateRcb == NULL) { + ClientReportControlBlock_destroy(returnRcb); + returnRcb = NULL; + } + } + + MmsValue_delete(rcb); return returnRcb; }