Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-755

Leaks in _mongoc_cluster_ismaster

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 1.1.9
    • Fix Version/s: 1.1.10
    • Component/s: libmongoc
    • Labels:
      None
    • Story Points:
      2
    • Sprint:
      C Driver 2015Q2 sprint 4

      Description

      As originally reported, a memory leak in this call stack:

                       libbson-1.0.so.0.0.0`bson_malloc+0xa
                       libbson-1.0.so.0.0.0`bson_copy_to+0xaf
                       libmongoc-1.0.so.0.0.0`_mongoc_cluster_ismaster+0x4cf
                       libmongoc-1.0.so.0.0.0`_mongoc_cluster_reconnect_replica_set+0x496
                       libmongoc-1.0.so.0.0.0`_mongoc_cluster_reconnect+0x2d3
                       libmongoc-1.0.so.0.0.0`_mongoc_cluster_sendv+0xe6
                       libmongoc-1.0.so.0.0.0`_mongoc_cursor_next+0x29c
                       libmongoc-1.0.so.0.0.0`mongoc_cursor_next+0x65
                       libmongoc-1.0.so.0.0.0`mongoc_client_command_simple+0x51
      

      Looking on the code https://github.com/mongodb/mongo-c-driver/blob/a0997439c86276f0dcdb49550636b11f3e407384/src/mongoc/mongoc-cluster.c#L1167
      it seems like that before copying bson to tags - you need to free it first.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: