From 94a2c2f64a1379ca5c9ce4dbbee45ce17250ab51 Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 25 Sep 2014 15:49:43 +0200 Subject: bus-proxyd: add some asserts Both as documentation, and to make Coverity happy. Fixes CID #1241495 and #1241496. --- src/bus-proxyd/bus-proxyd.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/bus-proxyd/bus-proxyd.c') diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c index a5387bb234..6a0fc7edfb 100644 --- a/src/bus-proxyd/bus-proxyd.c +++ b/src/bus-proxyd/bus-proxyd.c @@ -373,6 +373,8 @@ static int synthetic_reply_method_error(sd_bus_message *call, const sd_bus_error _cleanup_bus_message_unref_ sd_bus_message *m = NULL; int r; + assert(call); + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) return 0; @@ -387,6 +389,8 @@ static int synthetic_reply_method_errno(sd_bus_message *call, int error, const s _cleanup_bus_error_free_ sd_bus_error berror = SD_BUS_ERROR_NULL; + assert(call); + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) return 0; @@ -402,6 +406,8 @@ static int synthetic_reply_method_return(sd_bus_message *call, const char *types _cleanup_bus_message_unref_ sd_bus_message *m = NULL; int r; + assert(call); + if (call->header->flags & BUS_MESSAGE_NO_REPLY_EXPECTED) return 0; @@ -426,6 +432,8 @@ static int synthetic_reply_return_strv(sd_bus_message *call, char **l) { _cleanup_bus_message_unref_ sd_bus_message *m = NULL; int r; + assert(call); + r = sd_bus_message_new_method_return(call, &m); if (r < 0) return synthetic_reply_method_errno(call, r, NULL); -- cgit v1.2.3-54-g00ecf