]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
sd-bus: make sure dispatch_rqueue() initializes return parameter on all types of...
authorLennart Poettering <lennart@poettering.net>
Thu, 17 Jan 2019 17:15:37 +0000 (18:15 +0100)
committerLennart Poettering <lennart@poettering.net>
Fri, 1 Mar 2019 14:19:45 +0000 (15:19 +0100)
Let's make sure our own code follows coding style and initializes all
return values on all types of success (and leaves it uninitialized in
all types of failure).

src/libsystemd/sd-bus/sd-bus.c

index f000c6250bdf6cd91f01ae15cf8191111a3d2b7a..933a5c594eb50337e45ce12fb0b469eb3e5527d1 100644 (file)
@@ -1865,8 +1865,10 @@ static int dispatch_rqueue(sd_bus *bus, bool hint_priority, int64_t priority, sd
                 r = bus_read_message(bus, hint_priority, priority);
                 if (r < 0)
                         return r;
-                if (r == 0)
+                if (r == 0) {
+                        *m = NULL;
                         return ret;
+                }
 
                 ret = 1;
         }