Skip to content

Conversation

Copy link

Copilot AI commented Nov 29, 2025

Fixed cleanup order inconsistency in error paths when buffer allocations fail. The original fix destroyed synchronization primitives in a different order than the existing cleanup function.

Changes

  • Reordered cleanup to match existing pattern at lines 770-773: mutex → callback_message_mutex → callback_message_cond → reconnect_mutex
  • Applied consistent ordering to both send_buffer (lines 553-556) and recv_buffer (lines 564-567) allocation failure paths
// Before: condition variable destroyed after reconnect_mutex
pthread_mutex_destroy(&c->callback_message_mutex);
pthread_mutex_destroy(&c->reconnect_mutex);
pthread_cond_destroy(&c->callback_message_cond);

// After: condition variable destroyed between mutexes
pthread_mutex_destroy(&c->callback_message_mutex);
pthread_cond_destroy(&c->callback_message_cond);
pthread_mutex_destroy(&c->reconnect_mutex);

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix coverity resource leak in rtConnection_CreateInternal rtmessage: fix resource cleanup order in rtConnection_CreateInternal Nov 29, 2025
@svc-rdkeportal01
Copy link

Thank you @Copilot for creating this auto-fix PR! However, this issue has already been addressed.

The cleanup order was fixed in commit 8165c75 (pushed at 20:32 UTC), which reordered the cleanup to match the existing pattern at lines 770-773.

Since the fix is already in PR #398, this sub-PR is no longer needed. Closing as duplicate. 🙏

@github-actions github-actions bot locked and limited conversation to collaborators Nov 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants