cpprestsdk icon indicating copy to clipboard operation
cpprestsdk copied to clipboard

Memory leak with https schema while using cpprest SDK

Open ksasik opened this issue 4 years ago • 6 comments

When implementing restapi using cpprest with https schema, memory leak is observed which is pointing to CRYPTO libraries api call i.e CRYPTO_zalloc. If used with http schema, there is no memory leak observed.

Any help is highly appreciated...Thank you in advance.

ksasik avatar Feb 09 '22 11:02 ksasik

We recommend using libcurl for new projects.

However, more information about the leak would be appreciated. How are you detecting the leak? Can you generate a callstack for the leaking allocations?

barcharcraz avatar Feb 15 '22 03:02 barcharcraz

Hi @barcharcraz , our project is using openapi generator + cpprestsdk. https://openapi-generator.tech/docs/generators/cpp-restsdk

But libcurl is not a client generator that is supported by openapi. https://openapi-generator.tech/docs/generators

Which client generator would you suggest to use?

oneiric avatar Feb 18 '22 05:02 oneiric

We recommend using libcurl for new projects.

However, more information about the leak would be appreciated. How are you detecting the leak? Can you generate a callstack for the leaking allocations?

Hi @barcharcraz, Here is the sample code: image memory leak is detected using valgrind tool. Here is the leak call stack: image

ksasik avatar Feb 18 '22 06:02 ksasik

@barcharcraz When you say "we recommend using libcurl in projects", Do you mean use libcurl instead of libcrypto?

maruthihr avatar Feb 18 '22 09:02 maruthihr

Hi, any feedback on this issue? Facing the same problem.

bektfatm avatar Mar 29 '22 08:03 bektfatm