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

Coverity analysis defect 72658: 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
    • Labels:
      None

      Leak of memory or pointers to system resources

      Defect 72658 (STATIC_C)
      Checker RESOURCE_LEAK (subcategory none)
      File: /src/mongoc/mongoc-database.c
      Function _mongoc_database_find_collections_legacy
      /src/mongoc/mongoc-database.c, line: 708
      Assigning: "ctx" = storage returned from "bson_malloc(24UL)".

             ctx = (mongoc_database_find_collections_legacy_ctx_t *)bson_malloc (sizeof (*ctx));
      

      /src/mongoc/mongoc-database.c, line: 754
      Variable "ctx" going out of scope leaks the storage it points to.

             return cursor;
      

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

              Created:
              Updated:
              Resolved: