SSLproxy icon indicating copy to clipboard operation
SSLproxy copied to clipboard

possible memory leak?

Open applehxb opened this issue 1 year ago • 5 comments

Excuse me, why smtp and pop3 protocols do not register proto_free functions like HTTP protocols, will this cause ctx->protoctx->arg memory leaks of smtp and pop3 protocols ?

applehxb avatar Jul 09 '24 09:07 applehxb

Yes, I think you're right, that is expected to cause memory leaks. I'll check again to see if I'm missing something. If not, I should create proto_free functions for them too. Good catch, thanks. Btw, how did you find this issue, manual inspection or a tool like valgrind?

sonertari avatar Jul 09 '24 12:07 sonertari

Fixed now, thanks

sonertari avatar Jul 11 '24 08:07 sonertari

Yes, I think you're right, that is expected to cause memory leaks. I'll check again to see if I'm missing something. If not, I should create proto_free functions for them too. Good catch, thanks. Btw, how did you find this issue, manual inspection or a tool like valgrind?

Very glad to receive your reply. I didn't find the issue by tool, just with code review. I am very interested in the SSLproxy project, which is excellent. I am recently interested in SSL proxy, mail protocol proxy, mail content filtering, so I am learning this project code. Btw, currently this project supports SMTP/POP3, will IMAP be supported in the future? Thank you very much.

applehxb avatar Jul 11 '24 09:07 applehxb

IMAP has been in my todo list for more than 4 years now, but there are more important todo items in the list, so I wouldn't expect it any time soon.

sonertari avatar Jul 11 '24 10:07 sonertari

Btw, you can use tcp and ssl proxyspecs for imap and imaps protocols. I've never tried myself, but if we don't have to do anything special for IMAP, it should work. (But we do special things for smtp for request/response packets and protocol validation, as I guess you have seen.)

sonertari avatar Jul 11 '24 12:07 sonertari