Memory Leak in dbtests/perftests.cpp

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • 2.1.0
    • Affects Version/s: None
    • Component/s: Testing Infrastructure
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Issue based on post on GG

      Sentry found a couple new memory leaks today, introduced here:
      https://github.com/mongodb/mongo/commit/7c8cfd9
      I know it's test code, but someone may be interested in cleaning it up anyway. In dbtests/perftests.cpp, around line 180:
      DBClientConnection *c = new DBClientConnection(false, 0, 10);
      string err;
      if( c->connect("mongo05.10gen.cust.cbici.net", err) ) {
      if( !c->auth("perf", "perf", pwd, err) )

      { cout << "info: authentication with stats db failed: " << err << endl; // XXX: c leaked on this path assert(false); }


      conn = c;
      }
      else

      { cout << err << " (to log perfstats)" << endl; // XXX: c leaked on this path }


      I've noted the two locations where the connection 'c' is leaked in the above code (goes out of scope without being reassigned or deleted). Again, not a big deal if these are short-lived tests, but worth fixing if the tests are resource intensive.

            Assignee:
            Kevin Matulef (Inactive)
            Reporter:
            Sridhar Nanjundeswaran (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: