Skip to content

CDRIVER-4698 remove excess duplicate call #1357

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Jul 25, 2023

Summary

  • remove excess duplicate call to _mongoc_http_response_cleanup

Background & Motivation

Addresses Coverity issues with CIDs: 133796, 133795

This issue was flagged by Coverity as a possible "Double free". But I expect the duplicate call to _mongoc_http_response_cleanup does not result in a double free.

_mongoc_http_send zeroes the output res. Fields in res are set at the end of the call when success is guaranteed.

Nonetheless, removing the duplicate call to _mongoc_http_response_cleanup seems like an improvement. If future changes result in _mongoc_http_send possibly failing after setting fields in res, this may result in a double free.

This is not a bug. The duplicate call to `_mongoc_http_response_cleanup` does not currently result in a double free.
Nonetheless, the duplicate call may result in a double free if the implementation of `_mongoc_http_send` changes in the future.
@kevinAlbs kevinAlbs requested a review from vector-of-bool July 25, 2023 13:03
@kevinAlbs kevinAlbs merged commit 7c49ae2 into mongodb:master Jul 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants