diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-07-18 12:16:33 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2018-07-18 12:16:33 +0200 |
commit | 7ae8edcd03f74da123298330b76c3fc5425042ef (patch) | |
tree | 4f4daa06bddb2adf3e26f821b9aec481b1c2d422 /src/libsystemd/sd-bus/sd-bus.c | |
parent | 57916ea352b85153ecbed803d52861ca8b933dd3 (diff) | |
download | systemd-7ae8edcd03f74da123298330b76c3fc5425042ef.tar.gz |
bus: move BUS_DONT_DESTROY calls after asserts
It's not useful to bump the reference count before checking if the object is
NULL. Thanks to d40f5cc498 we can do this ;).
Related to https://bugzilla.redhat.com/show_bug.cgi?id=1576084,
https://bugzilla.redhat.com/show_bug.cgi?id=1575340,
https://bugzilla.redhat.com/show_bug.cgi?id=1575350. I'm not sure why those two
people hit this code path, while most people don't. At least we won't abort.
Diffstat (limited to 'src/libsystemd/sd-bus/sd-bus.c')
-rw-r--r-- | src/libsystemd/sd-bus/sd-bus.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c index deb664540a..689cbf74d3 100644 --- a/src/libsystemd/sd-bus/sd-bus.c +++ b/src/libsystemd/sd-bus/sd-bus.c @@ -2884,7 +2884,6 @@ finish: } static int bus_process_internal(sd_bus *bus, bool hint_priority, int64_t priority, sd_bus_message **ret) { - BUS_DONT_DESTROY(bus); int r; /* Returns 0 when we didn't do anything. This should cause the @@ -2900,6 +2899,8 @@ static int bus_process_internal(sd_bus *bus, bool hint_priority, int64_t priorit assert_return(!bus->current_message, -EBUSY); assert(!bus->current_slot); + BUS_DONT_DESTROY(bus); + switch (bus->state) { case BUS_UNSET: |