Fix double-free in error case.

Signed-off-by: Thiago Macieira <thiago@kde.org>
This commit is contained in:
Marcus Brinkmann 2010-03-15 15:39:45 +01:00 committed by Thiago Macieira
parent f4da942cb4
commit 3c657579a0

View file

@ -1288,16 +1288,14 @@ _dbus_transport_new_for_tcp_socket (const char *host,
host, port);
transport = _dbus_transport_new_for_socket (fd, NULL, &address);
_dbus_string_free (&address);
if (transport == NULL)
{
dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
_dbus_close_socket (fd, NULL);
_dbus_string_free (&address);
fd = -1;
}
_dbus_string_free (&address);
return transport;
error: