[systemd-devel] [PATCH] systemctl: fix double unref of a dbus message

Michal Schmidt mschmidt at redhat.com
Thu Jun 2 02:45:56 PDT 2011


After freeing the dbus message reset the pointer to NULL to avoid freeing it
again at the end of the function.

https://bugzilla.redhat.com/show_bug.cgi?id=709909
---

 src/systemctl.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/systemctl.c b/src/systemctl.c
index 99ada38..a82cce4 100644
--- a/src/systemctl.c
+++ b/src/systemctl.c
@@ -1565,6 +1565,7 @@ static int check_unit(DBusConnection *bus, char **args, unsigned n) {
 
                         dbus_error_free(&error);
                         dbus_message_unref(m);
+                        m = NULL;
                         continue;
                 }
 



More information about the systemd-devel mailing list