From 164ddcfae8bf33b8308928f01597882da2a86977 Mon Sep 17 00:00:00 2001 From: Kay Sievers Date: Sat, 2 Nov 2013 02:35:23 +0100 Subject: bus: make bus_map_all_properties() call idempotent --- src/libsystemd-bus/bus-util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/libsystemd-bus') diff --git a/src/libsystemd-bus/bus-util.c b/src/libsystemd-bus/bus-util.c index 857e0c16ed..bb5dd29a57 100644 --- a/src/libsystemd-bus/bus-util.c +++ b/src/libsystemd-bus/bus-util.c @@ -656,7 +656,7 @@ int bus_map_all_properties(sd_bus *bus, break; for (i = 0; map[i].type; i++) { - const char **p; + char **p; if (!streq(map[i].type, "s")) continue; @@ -664,6 +664,7 @@ int bus_map_all_properties(sd_bus *bus, continue; p = map[i].ptr; + free(*p); *p = strdup(s); if (!*p) { r = -ENOMEM; -- cgit v1.2.3-54-g00ecf