Skip to content

WinHTTP memory leak during failed requests #4490

@RickWinter

Description

@RickWinter

Repro code

// Copyright (c) Microsoft Corporation. All rights reserved.
// SPDX-License-Identifier: MIT

#include <iostream>
#include <stdexcept>

#include <azure/core/http/curl_transport.hpp>
#include <azure/storage/blobs.hpp>

int main()
{
  using namespace Azure::Storage::Blobs;

  std::string connectionStrign
      = "DefaultEndpointsProtocol=https;AccountName=nonexistingaccount;AccountKey="
        "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==;"
        "EndpointSuffix=core.windows.net";

  BlobClientOptions clientOptions;
  // clientOptions.Transport.Transport = std::make_shared<Azure::Core::Http::CurlTransport>();
  auto containerClient = Azure::Storage::Blobs::BlobContainerClient::CreateFromConnectionString(
      connectionStrign, "containername", clientOptions);

  while (true)
  {
    try
    {
      containerClient.CreateIfNotExists();
    }
    catch (std::exception& e)
    {
      std::cout << e.what() << std::endl;
    }
  }

  return 0;
}

Metadata

Metadata

Assignees

Labels

Azure.CoreClientThis issue points to a problem in the data-plane of the library.bugThis issue requires a change to an existing behavior in the product in order to be resolved.

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions