[Rpm-maint] [rpm-software-management/rpm] Add dbus-announce plugin (#1255)

Panu Matilainen notifications at github.com
Tue May 25 08:57:26 UTC 2021


@pmatilai commented on this pull request.



> +    if (!state->bus) {
+	return RPMRC_OK;
+    }
+
+    msg = dbus_message_new_signal("/org/rpm/Transaction", /* object name */
+				  "org.rpm.Transaction",  /* interface name */
+				  name);                  /* signal name */
+    if (NULL == msg) {
+	goto err;
+    }
+
+    dbcookie = rpmdbCookie(rpmtsGetRdb(ts));
+    if (!dbus_message_append_args(msg, DBUS_TYPE_STRING, &dbcookie)) {
+	goto err;
+    }
+    dbcookie = _free(dbcookie);

dbcookie will leak if dbus_message_append_args() fails. The generally fail-safe strategy is to initialize to NULL and free at central exit point than try be clever with local allocations.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1255#pullrequestreview-667568293
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20210525/7cd52b2e/attachment.html>


More information about the Rpm-maint mailing list