VirtualBox

Changeset 53874 in vbox


Ignore:
Timestamp:
Jan 20, 2015 6:47:06 PM (10 years ago)
Author:
vboxsync
Message:

VBoxService: fix a memory leak if libdbus exists but the dbus daemon isn't running

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxService/VBoxServiceVMInfo.cpp

    r53764 r53874  
    598598    DBusConnection *pConnection = NULL;
    599599    int rc2 = RTDBusLoadLib();
     600    bool fHaveLibDbus = false;
    600601    if (RT_SUCCESS(rc2))
    601602    {
    602603        /* Handle desktop sessions using ConsoleKit. */
    603604        VBoxServiceVerbose(4, "Checking ConsoleKit sessions ...\n");
    604 
     605        fHaveLibDbus = true;
    605606        dbus_error_init(&dbErr);
    606607        pConnection = dbus_bus_get(DBUS_BUS_SYSTEM, &dbErr);
     
    792793            s_iBitchedAboutDBus++;
    793794            VBoxServiceError("Unable to connect to system D-Bus (%d/3): %s\n", s_iBitchedAboutDBus,
    794                              pConnection && dbus_error_is_set(&dbErr) ? dbErr.message : "D-Bus not installed");
    795         }
    796     }
    797 
    798     if (   pConnection
     795                             fHaveLibDbus && dbus_error_is_set(&dbErr) ? dbErr.message : "D-Bus not installed");
     796        }
     797    }
     798
     799    if (   fHaveLibDbus
    799800        && dbus_error_is_set(&dbErr))
    800801        dbus_error_free(&dbErr);
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette