Home > Backend Development > PHP Tutorial > openssl_x509_parse调用之后内存泄漏

openssl_x509_parse调用之后内存泄漏

WBOY
Release: 2016-06-23 13:04:26
Original
1658 people have browsed it

目前需要调这个方法获取证书里面的证书序列号,但是发现每次获取完之后内存一直在涨。

代码:

        $x509data = file_get_contents ( "d:/certs/xxx.cer" );
        $resource = openssl_x509_read ( $x509data );
        $certdata = openssl_x509_parse ( $resource ); //        echo $certdata ['serialNumber']; //        echo $x509data;
        unset($certdata); //        openssl_x509_free($resource); //
循环个100000次可以看到明显一直在涨。
windows下试过php5.4+openssl0.9.8,php7.0+openssl1.0.2都有这问题。*nix还没试过。
不知道我是不是遗漏了什么可以释放的方法?


回复讨论(解决方案)

https://bugs.php.net/bug.php?id=65602 恩估计是证书的问题。

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template