_finalize is missing call to bson_destroy in an error case

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Unknown
    • 1.8.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Not Needed
    • None
    • None
    • None
    • None
    • None
    • None

      In _finalize in mongocrypt-ctx-encrypt.c, the error case starting on line 2011 (in commit 2ec9c3) appears to be missing bson_destroy (&converted). This is because in the case where ectx->explicit is false on line 1985 and the bson_t converted is initialized on line 1996, if the call to _mongocrypt_buffer_to_bson fails on line 2009, _finalize returns without having destroyed the converted instance.

            Assignee:
            Kyle Kloberdanz (Inactive)
            Reporter:
            Zachary Espiritu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: