diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2017-02-13 11:46:06 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2017-02-15 14:53:58 +0100 |
commit | 0e7047c1533e5e424b28959488e8ffa91613abd9 (patch) | |
tree | 6996cfeab7f17539922763d4a07cfa15c0e68481 | |
parent | 89e53f7139b134360fda9e43d47ebfb89fcaac92 (diff) | |
download | sssd-0e7047c1533e5e424b28959488e8ffa91613abd9.tar.gz sssd-0e7047c1533e5e424b28959488e8ffa91613abd9.tar.xz sssd-0e7047c1533e5e424b28959488e8ffa91613abd9.zip |
SBUS: Document how to free the result of sbus_create_message
It might not be apparent how to free the message constructed by
sbus_create_message(). This patch just adds a comment that tells the
developer to either free the parent context or unref the message with a
dbus call directly.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
-rw-r--r-- | src/sbus/sssd_dbus_utils.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sbus/sssd_dbus_utils.h b/src/sbus/sssd_dbus_utils.h index 74c21fb79..e53a7faef 100644 --- a/src/sbus/sssd_dbus_utils.h +++ b/src/sbus/sssd_dbus_utils.h @@ -25,6 +25,13 @@ errno_t sbus_talloc_bound_message(TALLOC_CTX *mem_ctx, DBusMessage *msg); errno_t sbus_error_to_errno(DBusError *error); errno_t sbus_check_reply(DBusMessage *reply); +/* Creates a DBusMessage from a vararg list. Please note that even though + * this function and sbus_create_message accept a talloc memory context, + * it is not valid to free the resulting message with talloc_free() directly. + * Instead, either free the parent memory context or directly call + * dbus_message_unref on the message if you pass NULL memory context to + * these functions + */ DBusMessage *sbus_create_message_valist(TALLOC_CTX *mem_ctx, const char *bus, const char *path, |