Replace bare malloc calls with bson_malloc

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Minor - P4
    • 1.25.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      There are a few places in the C driver source code where we call `malloc` directly instead of the `bson_malloc` wrapper. We need to replace all of these calls with the `bson_malloc` wrapper. Calls to malloc can be found as follows:

       

      ~/src/mongo-c-driver$ grep -rn "\<malloc (" * 2> /dev/null

       

      Please be sure to replace all of the allocation functions with their appropriate `bson_*` counterpart, i.e.,

      • free => bson_free
      • malloc => bson_malloc
      • calloc => bson_malloc0
      • realloc => bson_realloc

              Assignee:
              Roberto Sanchez
              Reporter:
              Kyle Kloberdanz (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: