summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/sd-bus.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-10-14 19:53:56 +0200
committerLennart Poettering <lennart@poettering.net>2013-10-14 19:53:56 +0200
commit8ce2afd6347dcf01e33fe1ff257e2b0fffa8edfe (patch)
treef90e1b693239377c283be59ead467993887c5ec2 /src/libsystemd-bus/sd-bus.c
parentd68888227d2e1093f8e18753ba2e10a1cab7c6ad (diff)
bus: make sure that we always keep a ref to the bus when we dispatch callbacks
Otherwise the callback might unref the bus we are processing and destroy the object while we are processing it.
Diffstat (limited to 'src/libsystemd-bus/sd-bus.c')
-rw-r--r--src/libsystemd-bus/sd-bus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libsystemd-bus/sd-bus.c b/src/libsystemd-bus/sd-bus.c
index 44c13d36a4..ee5f395569 100644
--- a/src/libsystemd-bus/sd-bus.c
+++ b/src/libsystemd-bus/sd-bus.c
@@ -1870,6 +1870,7 @@ null_message:
}
int sd_bus_process(sd_bus *bus, sd_bus_message **ret) {
+ BUS_DONT_DESTROY(bus);
int r;
/* Returns 0 when we didn't do anything. This should cause the