diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-12-10 20:38:04 +0000 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-12-10 20:38:04 +0000 |
commit | 5b1bc83f81bf318aa365dc539b2e0be00fdaa63b (patch) | |
tree | 8dcdf0282b5209b82d7180172de412033139a819 /src/libsystemd-bus/bus-message.c | |
parent | c8fa3f60302f6d1bf7b2f7b31fb7e5a46b3d53c1 (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/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 9e712717cc..0f19ee238a 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -791,7 +791,9 @@ _public_ sd_bus_message* sd_bus_message_ref(sd_bus_message *m) { } _public_ sd_bus_message* sd_bus_message_unref(sd_bus_message *m) { - assert_return(m, NULL); + + if (!m) + return NULL; assert(m->n_ref > 0); m->n_ref--; |