Potential memory leak in ConnectionString::connect

XMLWordPrintableJSON

    • Fully Compatible
    • ALL
    • Platform 4 06/05/15
    • 0
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Adam Midvidy (Inactive)
              Reporter:
              Randolph Tan
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Created:
                Updated:
                Resolved: