Skip to content

Poco::Net::FTPClientSession constructor can throw #5241

@micheleselea

Description

@micheleselea

In Poco::Net::FTPClientSession 2 of the 3 constructors can throw

	_pControlSocket->setReceiveTimeout(_timeout); <--here
	if (readWelcomeMessage)
	{
		receiveServerReadyReply(); <---here
	}
	else
	{
		_serverReady = true;
	}
	_pControlSocket->setReceiveTimeout(_timeout);<--here
	if (!username.empty())
		login(username, password); <--here

If the constructor throw the destructor is never called so we can have some memory leak because close() is never called

it's enough, for example, to create a socket on an http/https connection and pass it to the constructor: the receiveServerReadyReply will throw

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No fields configured for Bug.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions