Gowrima commented on PR #2209: URL: https://github.com/apache/zookeeper/pull/2209#issuecomment-2501648004
Hi @kezhuw, Thanks for your suggestions. Please review the following options to fix this, 1. If we remove strdup() for cert.ca, then cert.certstr and cert.ca will point to the first token. In this case, should certstr be removed from cert_t structure since certstr is not holding the whole string? 2. Introduce a new API to validate the input cert string, followed by strdup() to allocate heap memory for cert.ca, eventually freeing this memory in close(). 3. Assume that the input string is valid, go ahead with freeing the memory allocated for cert.ca by strdup(). I believe that (2) is the right approach, will willing to accept suggestions. Thank you! -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@zookeeper.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org