From b61c4a88c455b31ed943ec68d580f5e2b2592b38 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sat, 6 Feb 2021 20:46:44 +0100 Subject: [PATCH] properties: use json parse_string So that properties with object values get stripped properly. --- src/pipewire/properties.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pipewire/properties.c b/src/pipewire/properties.c index 9c969252e..46b69d216 100644 --- a/src/pipewire/properties.c +++ b/src/pipewire/properties.c @@ -172,10 +172,7 @@ int pw_properties_update_string(struct pw_properties *props, const char *str, si if (spa_json_is_container(value, len)) len = spa_json_container_len(&it[1], value, len); - if ((val = strndup(value, len)) == NULL) - return -errno; - - if (spa_json_is_string(value, len)) + if ((val = malloc(len)) != NULL) spa_json_parse_string(value, len, val); } count += pw_properties_set(&impl->this, key, val);