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

examples leaking memory in most cases

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Minor - P4 Minor - P4
    • None
    • None
    • Docs Examples, libmongoc

    Description

      Most examples in src/libmongoc/examples (e.g. examples/find-and-modify.c) exit before freeing initialized variables in the case of failure. A select few other examples (e.g. examples/example-session.c and examples/basic_aggregation/basic-aggregation.c) use a goto label and free all memory before exiting.

      Should all examples be adapted to use a goto label? This would likely require quite a bit of refactoring for the ~20-25 examples in the directory that don't use a label.

      Attachments

        Activity

          People

            Unassigned Unassigned
            evgeni.dobranov@mongodb.com Evgeni Dobranov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: