Issue Details (XML | Word | Printable)

Key: CORE-6217
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

[inet.cpp] Wrong work with pointer: delete ptr; ptr=new ;

Created: 07/Jan/20 10:53 AM   Updated: 10/Jan/20 11:43 AM
Component/s: Engine
Affects Version/s: 4.0 Beta 1, 3.0.5
Fix Version/s: 4.0 Beta 2, 3.0.6

QA Status: Cannot be tested


 Description  « Hide
inet.cpp, line 835-839

if (host.hasData())
{
delete port->port_connection;
port->port_connection = REMOTE_make_string(host.c_str());
}

REMOTE_make_string may throw exception and "delete port->port_connection" will hold pointer to released (deleted) memory block.

Please assign nullptr to port->port_connection after delete operation:

if (host.hasData())
{
delete port->port_connection;
                port->port_connection=nullptr;
port->port_connection = REMOTE_make_string(host.c_str());
}


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Kovalenko Dmitry added a comment - 07/Jan/20 11:55 AM - edited
-