-
Type: Improvement
-
Resolution: Won't Do
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Docs Examples, libmongoc
-
Not Needed
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.