There is no delete on smtp anywhere. If it has to be heap allocated it should be a smart pointer anyway. https://github.com/xcoder123/SimpleSmtp_SSL_QT5/blob/a15541e38c61d70af18bc6fe5002310909dcd95c/smtp_attachements/mainwindow.cpp#L35