|  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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: peter57 at post dot sk
New email:
PHP Version: OS:


 [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-2023 The PHP Group
All rights reserved.
Last updated: Thu Feb 02 12:05:53 2023 UTC