From: Ralf Habacker Date: Tue, 10 Mar 2020 21:59:19 +0000 (+0100) Subject: Fix missing release of the memory allocated in _dbus_connect_tcp_socket_with_nonce... X-Git-Tag: dbus-1.13.14~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00badeba;p=thirdparty%2Fdbus.git 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 --- diff --git a/dbus/dbus-sysdeps-win.c b/dbus/dbus-sysdeps-win.c index c5a9d0168..30cff66db 100644 --- a/dbus/dbus-sysdeps-win.c +++ b/dbus/dbus-sysdeps-win.c @@ -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; }