php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65458 curl memory leak
Submitted: 2013-08-16 06:56 UTC Modified: 2013-08-19 19:21 UTC
From: peter57 at post dot sk Assigned: aharvey (profile)
Status: Closed Package: cURL related
PHP Version: 5.5.2 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
29 + 10 = ?
Subscribe to this entry?

 
 [2013-08-16 06:56 UTC] peter57 at post dot sk
Description:
------------
When CURLOPT_HTTPHEADER is called more than once on the same curl handle, 
php/curl does not free the memory of the previous header data.

Similar to bug 63859.

Test script:
---------------
<?php

  $ch = curl_init();

  echo memory_get_usage(), "\n";

  for ($i = 0; $i < 10000; $i++)
  {
    curl_setopt($ch, CURLOPT_HTTPHEADER, [ "SOAPAction: getItems" ]);
  }

  echo memory_get_usage(), "\n";

  curl_close($ch);

  echo memory_get_usage(), "\n";



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-17 15:43 UTC] peter57 at post dot sk
-Operating System: Linux/Windows +Operating System: Linux -PHP Version: 5.4.18 +PHP Version: 5.5.2
 [2013-08-17 15:43 UTC] peter57 at post dot sk
Bug present in PHP 5.5.2
 [2013-08-19 19:20 UTC] aharvey@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2013-08-19 19:20 UTC] aharvey@php.net
The fix for this bug has been committed.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2013-08-19 19:21 UTC] aharvey@php.net
https://github.com/php/php-src/commit/aa7d3d8e6d8de73ebe8dd015fb5392a4bde5bfc6 is 
the fix — the bug tracker's auto-closing functionality seems to hate me at 
present!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 22:01:30 2024 UTC