summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2013-11-02 02:35:23 +0100
committerKay Sievers <kay@vrfy.org>2013-11-02 02:38:39 +0100
commit164ddcfae8bf33b8308928f01597882da2a86977 (patch)
tree6aed1c882e157e0e89b3b983defd6c0332d39ae3
parentb028f3e410a7b9ba6b6291a79164d3de2638eb0b (diff)
bus: make bus_map_all_properties() call idempotent
-rw-r--r--src/libsystemd-bus/bus-util.c3
1 files changed, 2 insertions, 1 deletions
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;