Skip to content

Commit

Permalink
Merge pull request #200 from kwuerl/master
Browse files Browse the repository at this point in the history
Fix for memleak and curl_close() never being called
  • Loading branch information
rmccue committed Apr 19, 2016
2 parents 12173db + faa4d04 commit b998001
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions library/Requests/Transport/cURL.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,11 @@ public function request($url, $headers = array(), $data = array(), $options = ar

$this->process_response($response, $options);

// Need to remove the $this reference from the curl handle.
// Otherwise Requests_Transport_cURL wont be garbage collected and the curl_close() will never be called.
curl_setopt($this->handle, CURLOPT_HEADERFUNCTION, null);
curl_setopt($this->handle, CURLOPT_WRITEFUNCTION, null);

return $this->headers;
}

Expand Down

0 comments on commit b998001

Please sign in to comment.