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

Refactor mongoc-metadata get_os_* functions to not use strndup

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: TBD
    • Component/s: None
    • Labels:
      None

      Description

      We follow a sort of ugly pattern in mongoc-metadata.c all of the get_os* functions (like _get_os_name or _get_os_arch) return a malloc'd string. A better pattern would be to have the caller pass in a buffer (and max size) and the function can just copy the string into that buffer.

        Attachments

          Activity

            People

            Assignee:
            backlog-c-driver Backlog - C Driver Team
            Reporter:
            ian.boros Ian Boros
            Participants:
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: