Skip to content

PHPC-677: Keep pem_file valid for life of mongoc_client_t #307

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 2 commits into from
Apr 26, 2016

Conversation

jmikola
Copy link
Member

@jmikola jmikola commented Apr 25, 2016

@jmikola
Copy link
Member Author

jmikola commented Apr 25, 2016

When merged to master, this highlights a memory leak with _mongoc_ssl_extract_subject() not freeing its extracted username. I've reported that upstream and it should be included in the fix with CDRIVER-1209.

char filename[MAXPATHLEN];
/* mongoc_client_set_ssl_opts() copies mongoc_ssl_opt_t shallowly;
* its strings must be kept valid for the life of mongoc_client_t */
manager->pem_file = ecalloc(1, MAXPATHLEN);
Copy link
Contributor

@derickr derickr Apr 26, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You seem to allocate it here, but you don't set it to anything?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

manager->pem_file is set via the VCWD_REALPATH() macro below.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@derickr
Copy link
Contributor

derickr commented Apr 26, 2016

LGTM

@jmikola jmikola merged commit 62a4175 into mongodb:v1.1 Apr 26, 2016
jmikola added a commit that referenced this pull request Apr 26, 2016
@jmikola jmikola deleted the 1.1-phpc-677 branch April 26, 2016 16:27
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