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

Coverity analysis defect 76449: Resource leak

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.3.0-beta0
    • Affects Version/s: None
    • Component/s: None
    • None

      Leak of memory or pointers to system resources

      Defect 76449 (STATIC_C)
      Checker RESOURCE_LEAK (subcategory none)
      File: /src/mongoc/mongoc-cluster.c
      Function _mongoc_cluster_add_node
      /src/mongoc/mongoc-cluster.c, line: 1249
      Assigning: "stream" = storage returned from "_mongoc_client_create_stream(cluster->client, &sd->host, error)".

             stream = _mongoc_client_create_stream(cluster->client, &sd->host, error);
      

      /src/mongoc/mongoc-cluster.c, line: 1263
      Resource "stream" is not freed or pointed-to in unimplemented function "mongoc_stream_failed".

                mongoc_stream_failed (stream);
      

      /src/mongoc/mongoc-cluster.c, line: 1264
      Variable "stream" going out of scope leaks the storage it points to.

                return NULL;
      

            Assignee:
            bjori Hannes Magnusson
            Reporter:
            xgen-internal-coverity Coverity Collector User
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: