bson getOwned() unproper used

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Sharding
    • None
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      https://github.com/mongodb/mongo/blob/53adeef7dbf5170a94f3e6d25425e8524fb9d062/src/mongo/db/s/collection_metadata.cpp#L104

      getOwned() here does nothing to the object being called.
      It only returns a new copy.
      it is unproper used, and may lead to bad memory reference.
      Perhaps metadata->_keyPattern = this->_keyPattern.getOwned() is what you need.

            Assignee:
            Ramon Fernandez
            Reporter:
            deyukong
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: