From: Michael Wallner Date: Tue, 14 Jun 2005 16:03:10 +0000 (+0000) Subject: - free handles X-Git-Tag: RELEASE_0_9_0~16 X-Git-Url: https://git.m6w6.name/?a=commitdiff_plain;h=208e6a34f0d48978279a2e80d336e19dca936486;p=m6w6%2Fext-http - free handles --- diff --git a/http_request_pool_api.c b/http_request_pool_api.c index a38e73f..610412a 100644 --- a/http_request_pool_api.c +++ b/http_request_pool_api.c @@ -135,7 +135,7 @@ PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool TSRMLS_D fprintf(stderr, "Detaching %d requests from pool %p\n", count, pool); #endif /* - * we cannot apply a function to the llist which actually detaches + * we cannot apply a function to the llist which actually detaches * the curl handle *and* removes the llist element -- * so let's get our hands dirty */ @@ -143,13 +143,14 @@ PHP_HTTP_API void _http_request_pool_detach_all(http_request_pool *pool TSRMLS_D int i = 0; zend_llist_position pos; zval **handle, **handles = emalloc(count * sizeof(zval *)); - + for (handle = zend_llist_get_first_ex(&pool->handles, &pos); handle; handle = zend_llist_get_next_ex(&pool->handles, &pos)) { handles[i++] = *handle; } for (i = 0; i < count; ++i) { http_request_pool_detach(pool, handles[i]); } + efree(handles); } }