projects
/
m6w6
/
ext-http
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
- free created bodies at least in detach_all()
[m6w6/ext-http]
/
http_request_pool_api.c
diff --git
a/http_request_pool_api.c
b/http_request_pool_api.c
index b78e354174ab5e358195a662bd265499cd123bfe..64224fe5df87217a7a341bf4da62e9372e19240a 100644
(file)
--- a/
http_request_pool_api.c
+++ b/
http_request_pool_api.c
@@
-168,11
+168,21
@@
PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool TSRMLS_D
for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) {
handles[i++] = *handle;
}
for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) {
handles[i++] = *handle;
}
+ /* should never happen */
+ if (i != count) {
+ zend_error(E_ERROR, "number of fetched request handles do not match overall count");
+ count = i;
+ }
for (i = 0; i < count; ++i) {
http_request_pool_detach(pool, handles[i]);
}
efree(handles);
}
for (i = 0; i < count; ++i) {
http_request_pool_detach(pool, handles[i]);
}
efree(handles);
}
+#if HTTP_DEBUG_REQPOOLS
+ fprintf(srderr, "Destroying %d request bodies of pool %p\n", zend_llist_count(&pool->bodies), pool);
+#endif
+ /* free created bodies too */
+ zend_llist_clean(&pool->bodies);
}
}