Xuekun Hu wrote:
So, same reason. Also in file mod_mem_cache.c around line 786, there
is a malloc(mobj->m_len), and a few lines later, another
malloc(obj->count) is performed.

If the second malloc fails, I think also should add something like
  free(mobj->m);
  mobj->m = NULL;

reasonable?

No. Once a cache object is allocated, it will be cleaned up by cleanup_cache_object when the reference count drops to 0. To understand how this works, find this line of code.

   apr_pool_cleanup_register(r->pool, obj, decrement_refcount,
                              apr_pool_cleanup_null);

When r->pool is cleaned up, decrement_refcount is called. decrement_refcount will call cleanup_cache_onject when the refcount goes to 0.

Bill

Reply via email to