From 00badebaac50245d141037005a4a108eac15f5bf Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 10 Mar 2020 22:59:19 +0100 Subject: [PATCH] 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 --- dbus/dbus-sysdeps-win.c | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.47.3