Skip to content

Fix context leak when socket is not cloed explicitly#496

Open
nataraj-hates-MS-for-stealing-github wants to merge 2 commits intoradiator-software:masterfrom
nataraj-hates-MS-for-stealing-github:old-handle-fix
Open

Fix context leak when socket is not cloed explicitly#496
nataraj-hates-MS-for-stealing-github wants to merge 2 commits intoradiator-software:masterfrom
nataraj-hates-MS-for-stealing-github:old-handle-fix

Conversation

@nataraj-hates-MS-for-stealing-github
Copy link

@nataraj-hates-MS-for-stealing-github nataraj-hates-MS-for-stealing-github commented Jan 2, 2025

Fix memory leak described in #469.

If this patch is applied, this module build with ASan enabled no longer fails on following sample:

use strict;
use Symbol qw(gensym);
use Net::SSLeay::Handle;

my @uris = ('ya.ru', 'google.com');
#my @uris = ('google.com');

for my $uri (@uris)
{
  my $ssl = gensym();
  tie(*$ssl, "Net::SSLeay::Handle", $uri, 443);
  print $ssl "GET / HTTP/1.0\r\n\r\n";

  my $response = do { local $/ = undef; <$ssl> };
}

This does not solves all ASan related problems, but reduces failed tests from 13 to 11 for me.

PS please refer me as NATARAJ (Nikolay Shaplov) if you ever would like to mention me anywhere...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant