Use zend_string_release() to free class names

XMLWordPrintableJSON

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

      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:
            Jeremy Mikola
            Reporter:
            Jeremy Mikola
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: