-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: libservices: use DBusError API properly
Before, we set error.name and error.message directly in most cases. Now, we use dbus_set_error_const(). This is effectively the same, but it is the proper usage of the API, at the cost of slightly more overhead due to the function call and some checking. Also, we now use dbus_error_free() consistently for all DBusError objects. The combination of these changes gives us more reliable memory management, including fixing one memory leak: pcmk_dbus_find_error() directly assigned name and message in most cases, but used dbus_set_error_from_message() in one case, which allocates the name and message and would leak.
- Loading branch information
Showing
3 changed files
with
62 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters