Fix missing release of the memory allocated in _dbus_connect_tcp_socket_with_nonce() in OOM case

If there is no more memory available within the mentiond function, e.g.,
when checking memory management, the release of memory allocated by
getaddrinfo() is missing.

Coverity CID: 354880
This commit is contained in:
Ralf Habacker 2020-03-10 22:59:19 +01:00
parent bf0eaec4d9
commit 00badebaac

View file

@ -1578,6 +1578,7 @@ _dbus_connect_tcp_socket_with_nonce (const char *host,
if (connect_error == NULL)
{
freeaddrinfo(ai);
_DBUS_SET_OOM (error);
goto out;
}
@ -1592,6 +1593,7 @@ _dbus_connect_tcp_socket_with_nonce (const char *host,
{
dbus_error_free (connect_error);
dbus_free (connect_error);
freeaddrinfo(ai);
_DBUS_SET_OOM (error);
goto out;
}