1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2025-01-12 09:17:44 +03:00

sd-bus: free everything when bus_set_address_user fails (#6552)

Fixes:
```
$ env -i valgrind --leak-check=full ./build/test-bus-chat
...
==7763== 1,888 (1,824 direct, 64 indirect) bytes in 1 blocks are
definitely lost in loss record 2 of 2
==7763==    at 0x4C2FA50: calloc (vg_replace_malloc.c:711)
==7763==    by 0x4F8FF9A: sd_bus_new (sd-bus.c:175)
==7763==    by 0x4F938BF: sd_bus_open_user (sd-bus.c:1138)
==7763==    by 0x109ACD: server_init (test-bus-chat.c:70)
==7763==    by 0x10BCF8: main (test-bus-chat.c:526)
==7763==
```

Closes #6481
This commit is contained in:
Evgeny Vereshchagin 2017-08-08 09:42:51 +03:00 committed by Lennart Poettering
parent 5aece00d45
commit 4f6631c8fc

View File

@ -1141,7 +1141,7 @@ _public_ int sd_bus_open_user(sd_bus **ret) {
r = bus_set_address_user(b);
if (r < 0)
return r;
goto fail;
b->bus_client = true;
b->is_user = true;