|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75306 Memleak in SoapClient
Submitted: 2017-10-03 09:00 UTC Modified: 2018-11-04 11:04 UTC
Avg. Score:4.0 ± 0.8
Reproduced:2 of 2 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: valov at mtsbank dot ru Assigned:
Status: Closed Package: SOAP related
PHP Version: 7.1.10 OS: RHEL 6
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: valov at mtsbank dot ru
New email:
PHP Version: OS:


 [2017-10-03 09:00 UTC] valov at mtsbank dot ru
Memleak in SoapClient detected, in test script after few seconds you will get error: "Allowed memory size exhausted".

Test script:
while(true) {
  $client = new SoapClient("test.wsdl");

You can use any test.wsdl specification, for example


fix-refcounting (last revision 2018-11-04 11:04 UTC by

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2018-01-01 21:10 UTC]
-Status: Open +Status: Verified
 [2018-01-01 21:10 UTC]
Can reproduce with soap.wsdl_cache_enabled=0.
 [2018-11-04 11:04 UTC]
In this case, a new stream context is allocated[1], converted to a
zval[2] which increases the refcount, but the refcount is only
decreased once[3], resulting in the reported memory leak.  So not
increasing the refcount when converting to a zval would solve this
issue.  However, if a stream context is passed in the $options
array, its refcount has to be increased to avoid premature

[1] <>
[2] <>
[3] <>
 [2018-11-04 11:04 UTC]
The following patch has been added/updated:

Patch Name: fix-refcounting
Revision:   1541329477
 [2023-10-26 18:00 UTC]
Automatic comment on behalf of nielsdos
Log: Fix bug #75306: Memleak in SoapClient
 [2023-10-26 18:00 UTC]
-Status: Verified +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Feb 28 16:01:33 2024 UTC