[SERVER-6826] Potential memory leak in ConnectionString::connect Created: 22/Aug/12  Updated: 19/Sep/15  Resolved: 21/May/15

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 2.2.0-rc1
Fix Version/s: 3.0.4, 3.1.4

Type: Bug Priority: Major - P3
Reporter: Randolph Tan Assignee: Adam Midvidy
Resolution: Done Votes: 0
Labels: cxxcopy
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Completed:
Sprint: Platform 4 06/05/15
Participants:
Linked BF Score: 0

 Description   

For example in the case of normal connections:

case MASTER: {
    DBClientConnection * c = new DBClientConnection(true);
    c->setSoTimeout( socketTimeout );
    log(1) << "creating new connection to:" << _servers[0] << endl;
    if ( ! c->connect( _servers[0] , errmsg ) ) { // <------ This can throw an assertion and c will never be cleaned!!!
        delete c;
        return 0;
    }
    log(1) << "connected connection!" << endl;
    return c;
}

We should also check whether the other cases have the same issue.



 Comments   
Comment by Githook User [ 21/May/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-6826 fix exception safety in ConnectionString::connect
Branch: v3.0
https://github.com/mongodb/mongo/commit/42140e7002960ef23227e78289ed07a43ea4d14e

Comment by Githook User [ 21/May/15 ]

Author:

{u'username': u'amidvidy', u'name': u'Adam Midvidy', u'email': u'amidvidy@gmail.com'}

Message: SERVER-6826 fix exception safety in ConnectionString::connect
Branch: master
https://github.com/mongodb/mongo/commit/1a124ee72334675b9395f57bf2464ca8e0789c29

Generated at Thu Feb 08 03:12:48 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.