]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
Fix missing release of the memory allocated in _dbus_connect_tcp_socket_with_nonce...
authorRalf Habacker <ralf.habacker@freenet.de>
Tue, 10 Mar 2020 21:59:19 +0000 (22:59 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Tue, 10 Mar 2020 22:03:03 +0000 (23:03 +0100)
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

index c5a9d0168a5c003365799423196e1d08a6402c79..30cff66db10bb1c877139feccec9361e3d13e25b 100644 (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;
             }