On Fri May 2 10:55:33 2025 +0000, Hans Leidekker wrote:
Initialization of the context takes multiple steps. ntlm_chat() can also fail and leave a buffer behind. I'm not sure if it's better to rely on individual steps to clean up after themselves instead of having a catch-all here.
Sure, it's your call. I'm thinking about it as: - `ntlm_fork` does initialization, if it fails context should not be created - `ntlm_chat` operates on context, so it's not responsible for clearing it in case of error - `ntlm_cleanup` cleanups the context
It's a very common pattern, like e.g. in file operations - you don't expect that failed read will close file descriptor. But you do expect that failed open will not create it.
Current code looks very strange for me. We're writing "BH" to the pipe, so I'm expecting that there may be a path that reads it but it's never read.