hi,
 im reviewing the source code of zend_llist.c and it appears there may be an
inconsistency in the way deletions are handled which may cause leaks.
  in particular the macro DEL_LLIST_ELEMENT only releases memory for a node
if a destructor is specified for the zend_llist, whereas memory is always
allocated for the node when an insert is performed.
this macro is used only in zend_llist_apply_with_del and
zend_llist_del_element. note that
no other code in the file assumes that the destructor function is
responsible for the deallocation of the _node_

compare DEL_LLIST_ELEMENT (snippet)

   if ((l)->dtor) {\
    (l)->dtor((current)->data);\
    pefree((current), (l)->persistent);\
   }\

with zend_llist_destroy

  if (l->dtor) {
   l->dtor(current->data);
  }
  pefree(current, l->persistent);


l0t3k



-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to