Azure / azure-c-shared-utility

Azure C SDKs common code
Other
111 stars 203 forks source link

Fix for memory leak in http-proxy-io #592

Closed momuno closed 2 years ago

momuno commented 2 years ago

Memory leak found during investigation of logic pertaining to xio_retrieveoptions. Fix could be 2 lines. Instead, approach chosen to mimic pattern found in other files using parallel logic, such as tlsio_mbedts.c and tlsio_openssl.c

Because OptionHandler_AddOption mallocs memory for the option-value being added (in this case underlying_io_options), which has already been allocated once by xio_retrieveoptions, the memory must be destroyed if OptionHandler_AddOption succeeds.

momuno commented 2 years ago

Will appreciate a second set of eyes on this :) sanity check...

momuno commented 2 years ago

/azp run

azure-pipelines[bot] commented 2 years ago
Azure Pipelines successfully started running 1 pipeline(s).