[CDRIVER-4079] Always initialize reply in stream fetch functions Created: 14/Jul/21 Updated: 15/Apr/22 |
|
| Status: | Backlog |
| Project: | C Driver |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Trivial - P5 |
| Reporter: | Kevin Albertson | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Epic Link: | CDRIVER-4107 |
| Description |
|
Motivation A common pattern in libmongoc is to initialize an output BSON reply regardless of whether the function call succeeded or failed. This makes it simpler for callers to know how to clean up after:
The functions following functions do not follow this pattern:
They only initialize a BSON reply on failure. Expecting uninitialized bson_t as an output argument has its own problems (see Scope |