diff --git a/src/iec61850/client/client_goose_control.c b/src/iec61850/client/client_goose_control.c index 7873818b..7fa44444 100644 --- a/src/iec61850/client/client_goose_control.c +++ b/src/iec61850/client/client_goose_control.c @@ -589,6 +589,7 @@ IedConnection_setGoCBValues(IedConnection self, IedClientError* error, ClientGoo } *error = iedConnection_mapMmsErrorToIedError(mmsError); + goto exit_function; } else { diff --git a/src/mms/iso_mms/client/mms_client_write.c b/src/mms/iso_mms/client/mms_client_write.c index e1e62239..e99a6e1b 100644 --- a/src/mms/iso_mms/client/mms_client_write.c +++ b/src/mms/iso_mms/client/mms_client_write.c @@ -132,8 +132,12 @@ mmsClient_parseWriteMultipleItemsResponse(ByteBuffer* message, int32_t bufPos, M exit_with_error: *mmsError = MMS_ERROR_PARSING_RESPONSE; - if (accessResults != NULL) - LinkedList_destroyDeep(*accessResults, (LinkedListValueDeleteFunction) MmsValue_delete); + if (accessResults != NULL) { + if (*accessResults) { + LinkedList_destroyDeep(*accessResults, (LinkedListValueDeleteFunction) MmsValue_delete); + *accessResults = NULL; + } + } }