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

                 Key: CORE-6217
                 URL: http://tracker.firebirdsql.org/browse/CORE-6217
             Project: Firebird Core
          Issue Type: Bug
          Components: Engine
    Affects Versions: 3.0.5
            Reporter: Kovalenko Dmitry


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 delete 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());
        }


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to