(Hello CCF, sorry to cause trouble.)
Description
In CCF-level crypto code, there are multiple examples of non-trivial ctors that throw exceptions without freeing resources thus far created. (When c++ objects fail during construction, the object's dtor will not be called.) For example, the class TlsClient's ctor calls member function connect(), which does quite a bit of work and throws exceptions on error. Any resources created in the ctor prior to the exception will not be freed.
ccf\src\clients\tls_client.h
There are other examples of this pattern in CCF's higher-level crypto code. (By "higher-level" I mean in CCF proper, that is, not in 3rd-party code.)
Expected behavior
Memory leaks will not occur, including during failure cases.
(Hello CCF, sorry to cause trouble.)
Description
In CCF-level crypto code, there are multiple examples of non-trivial ctors that throw exceptions without freeing resources thus far created. (When c++ objects fail during construction, the object's dtor will not be called.) For example, the class TlsClient's ctor calls member function connect(), which does quite a bit of work and throws exceptions on error. Any resources created in the ctor prior to the exception will not be freed.
ccf\src\clients\tls_client.h
There are other examples of this pattern in CCF's higher-level crypto code. (By "higher-level" I mean in CCF proper, that is, not in 3rd-party code.)
Expected behavior
Memory leaks will not occur, including during failure cases.