diff options
author | Kevin Kuehler <keur@xcf.berkeley.edu> | 2019-12-10 01:58:01 -0800 |
---|---|---|
committer | Kevin Kuehler <keur@xcf.berkeley.edu> | 2020-01-07 18:48:50 -0800 |
commit | 411975ce63b28194b21b964268efaa04b19cbb37 (patch) | |
tree | f6694b1d661dee356cae6fb8e2b36d53db0b35a1 /src/shared/bus-util.c | |
parent | 8ee08dc564cc960e9654d50a51fceefe882ff591 (diff) | |
download | systemd-411975ce63b28194b21b964268efaa04b19cbb37.tar.gz |
shared/bus-util: Don't replace exsting strv
Change the behavior of string arrays in a bus property map. Previously,
passing the same strv pointer to more than one map entry would result in
the old strv being freed and overwritten. With this change, an existing
strv pointer is appended to.
This is important if we want to create one strv comprised of multiple
dependencies. This makes it so callers don't have to create one strv per
dependency and subsequently merge them into one strv.
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r-- | src/shared/bus-util.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index aea46d3119..10c05eba18 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1127,7 +1127,7 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, unsigne if (r < 0) return r; - return strv_free_and_replace(*p, l); + return strv_extend_strv(p, l, false); } case SD_BUS_TYPE_BOOLEAN: { |