diff options
-rw-r--r-- | src/libsystemd-bus/bus-creds.c | 4 | ||||
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 4 | ||||
-rw-r--r-- | src/libsystemd-bus/sd-bus.c | 4 | ||||
-rw-r--r-- | src/libsystemd-bus/sd-event.c | 8 |
4 files changed, 15 insertions, 5 deletions
diff --git a/src/libsystemd-bus/bus-creds.c b/src/libsystemd-bus/bus-creds.c index 1eb0e02e7e..9d90c49c1e 100644 --- a/src/libsystemd-bus/bus-creds.c +++ b/src/libsystemd-bus/bus-creds.c @@ -72,7 +72,9 @@ _public_ sd_bus_creds *sd_bus_creds_ref(sd_bus_creds *c) { } _public_ sd_bus_creds *sd_bus_creds_unref(sd_bus_creds *c) { - assert_return(c, NULL); + + if (!c) + return NULL; if (c->allocated) { assert(c->n_ref > 0); 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--; 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); diff --git a/src/libsystemd-bus/sd-event.c b/src/libsystemd-bus/sd-event.c index b5ddf71ebe..282e9145e7 100644 --- a/src/libsystemd-bus/sd-event.c +++ b/src/libsystemd-bus/sd-event.c @@ -384,7 +384,9 @@ _public_ sd_event* sd_event_ref(sd_event *e) { } _public_ sd_event* sd_event_unref(sd_event *e) { - assert_return(e, NULL); + + if (!e) + return NULL; assert(e->n_ref >= 1); e->n_ref--; @@ -973,7 +975,9 @@ _public_ sd_event_source* sd_event_source_ref(sd_event_source *s) { } _public_ sd_event_source* sd_event_source_unref(sd_event_source *s) { - assert_return(s, NULL); + + if (!s) + return NULL; assert(s->n_ref >= 1); s->n_ref--; |