- free handles
authorMichael Wallner <mike@php.net>
Tue, 14 Jun 2005 16:03:10 +0000 (16:03 +0000)
committerMichael Wallner <mike@php.net>
Tue, 14 Jun 2005 16:03:10 +0000 (16:03 +0000)
http_request_pool_api.c

index a38e73fc10f6f2f5a0148d97b0cf0f7aa0251ee3..610412ac24f28e4477f40c70aef8e7d96cd99b63 100644 (file)
@@ -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);
        }
 }