|  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
Status: Closed Package: cURL related
PHP Version: 5.5.2 OS: Linux
Private report: No CVE-ID:
 [2013-08-16 06:56 UTC] peter57 at post dot sk
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:

  $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";


  echo memory_get_usage(), "\n";


Add a Patch

Pull Requests

Add a Pull Request


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]
-Status: Open +Status: Closed -Assigned To: +Assigned To: aharvey
 [2013-08-19 19:20 UTC]
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

 For Windows:
Thank you for the report, and for helping us make PHP better.

 [2013-08-19 19:21 UTC] is 
the fix — the bug tracker's auto-closing functionality seems to hate me at 
PHP Copyright © 2001-2015 The PHP Group
All rights reserved.
Last updated: Thu Oct 08 21:01:31 2015 UTC