Uploaded image for project: 'PHP Driver: Extension'
  1. PHP Driver: Extension
  2. PHPC-923

Use zend_string_release() to free class names

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.2.6
    • Affects Version/s: 1.2.5
    • Component/s: None
    • Labels:
      None
    • Environment:
      PHP 7.1

      Generally, the extension uses zend_string_release() to free zend_string objects after use, which only frees the string's memory if its reference count dips below 1.

      That said, a few places are still using zend_string_free(), which always asserts that the reference count is zero before freeing the string's memory. Two such occurrences are when freeing the zend_string created to fetch a zend_class_entry for a type map class and "__pclass" field. This is problematic if a custom autoloader adds a reference to the class name, which is exactly what Composer does to cache missing classes.

      Whenever possible, we should use zend_string_release() to free zend_string objects.

            Assignee:
            jmikola@mongodb.com Jeremy Mikola
            Reporter:
            jmikola@mongodb.com Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: