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

Replace bare malloc calls with bson_malloc

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.25.0
    • Affects Version/s: None
    • Component/s: 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@mongodb.com Roberto Sanchez
            Reporter:
            kyle.kloberdanz@mongodb.com Kyle Kloberdanz (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: