chiark / gitweb /
bus: fix issue with reference counting
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 16 Jan 2014 06:15:17 +0000 (01:15 -0500)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 16 Jan 2014 06:15:17 +0000 (01:15 -0500)
b7fc42e03 introduced a regression.

src/libsystemd/sd-bus.c

index b76221e..95d80db 100644 (file)
@@ -1425,8 +1425,8 @@ static int dispatch_wqueue(sd_bus *bus) {
                          * it got full, then all bets are off
                          * anyway. */
 
-                        sd_bus_message_unref(bus->wqueue[0]);
                         bus->wqueue_size --;
+                        sd_bus_message_unref(bus->wqueue[0]);
                         memmove(bus->wqueue, bus->wqueue + 1, sizeof(sd_bus_message*) * bus->wqueue_size);
                         bus->windex = 0;