keygen-sh / example-cpp-cryptographic-license-files

Example of verifying cryptographically signed and encrypted license files using C++, OpenSSL, Ed25519 and AES-256-GCM.
https://keygen.sh
MIT License
9 stars 8 forks source link

Memory leak(?) #3

Open nkallen opened 1 year ago

nkallen commented 1 year ago

https://github.com/keygen-sh/example-cpp-cryptographic-license-files/blob/30682baebd4897ac1f27350aefbc4b648aa66db5/main.cpp#LL278C26-L278C29

I think this will leak in the early return cases. Probably easiest to use a std::vector on the stack and pass .data() . Alternatively use unique_ptr

nkallen commented 1 year ago

Actually it always leaks since the string constructor always copies

pstavirs commented 11 months ago

Fixed by 53fa084 - this issue can be closed