summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-12-10 20:38:04 +0000
committerLennart Poettering <lennart@poettering.net>2013-12-10 20:38:04 +0000
commit5b1bc83f81bf318aa365dc539b2e0be00fdaa63b (patch)
tree8dcdf0282b5209b82d7180172de412033139a819 /src/libsystemd-bus/sd-bus.c
parentc8fa3f60302f6d1bf7b2f7b31fb7e5a46b3d53c1 (diff)
bus: when we _unref() a NULL pointer, don't use assert_return()
We support unreffing NULL pointers just fine and we shouldn't pay the _unlikely_() price for it, not get a debug message if we do, hence let's not use assert_return() here.
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r--src/libsystemd-bus/sd-bus.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 81bfe0d922..91fac4815e 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -1214,7 +1214,9 @@ _public_ sd_bus *sd_bus_ref(sd_bus *bus) {
}
_public_ sd_bus *sd_bus_unref(sd_bus *bus) {
- assert_return(bus, NULL);
+
+ if (!bus)
+ return NULL;
if (REFCNT_DEC(bus->n_ref) <= 0)
bus_free(bus);