Changeset 705 in svn for trunk


Ignore:
Timestamp:
2011-03-19T15:33:02+01:00 (4 years ago)
Author:
Xuefer
Message:

fix builtin constant memory leak on compile

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r704 r705  
    1515 * compatibility fix: fix segv on shutdown when ionCube Loader is loaded
    1616 * fixed undefined index for xcache.count=1 and xcache.var_size>1
     17 * fix builtin constant memory leak on compile
    1718
    18191.3.1 2010-11-27
  • trunk/utils.c

    r682 r705  
    649649}
    650650/* }}} */
    651 void xc_free_zend_constant(zend_constant *c) /* {{{ */
     651static void xc_free_zend_constant(zend_constant *c) /* {{{ */
    652652{
    653653    if (!(c->flags & CONST_PERSISTENT)) {
     
    702702    zend_hash_init_ex(&TG(zend_constants),  20, NULL, (dtor_func_t) xc_free_zend_constant, h->persistent, h->bApplyProtection);
    703703    xc_copy_internal_zend_constants(&TG(zend_constants), &XG(internal_constant_table));
    704     {
    705         zend_constant tmp_const;
    706         zend_hash_copy(&TG(zend_constants), &XG(internal_constant_table), (copy_ctor_func_t) xc_zend_constant_ctor, (void *) &tmp_const, sizeof(tmp_const));
    707     }
    708704    TG(internal_constant_tail) = TG(zend_constants).pListTail;
    709705#endif
     
    775771
    776772#ifdef HAVE_XCACHE_CONSTANT
     773    for (b = TG(zend_constants).pListHead; b != NULL && b != TG(internal_constant_tail); b = b->pListNext) {
     774        zend_constant *c = (zend_constant*) b->pData;
     775        xc_free_zend_constant(c);
     776    }
     777
    777778    b = TG(internal_constant_tail) ? TG(internal_constant_tail)->pListNext : TG(zend_constants).pListHead;
    778779    /* install constants */
Note: See TracChangeset for help on using the changeset viewer.