Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(pubsub): Fix mqtt reader group shutdown
Fix open62541#6130 with a correct pubsub reader group status when the pubsub connection is disabled. Using the current connection state leads to multiple calls of UA_ReaderGroup_disconnect which also adds multiple deleteTopicConnection (eventloop_mqtt.c) as delayed callbacks. This ends with the second call of UA_free(tc). This is actually a double free error which is now displayed as invalid read on later memory access by valgrind test. Changing state to readerGroup->state (in this case UA_PUBSUBSTATE_PREOPERATIONAL -> UA_PUBSUBSTATE_PREOPERATIONAL) avoids the earlier call of UA_ReaderGroup_disconnect and deleteTopicConnection is called only once. The new pattern is similar with writerGroup->state for publisher a few lines later. Signed-off-by: Vasilij Strassheim <[email protected]>
- Loading branch information