pulse-server: avoid leaks in error path

When reading the properties failes, make sure to free the properties
anyway.
This commit is contained in:
Wim Taymans 2021-03-25 17:34:44 +01:00
parent 5629885e41
commit e3b0cc76a3

View file

@ -828,12 +828,15 @@ static int message_dump(enum spa_log_level level, struct message *m)
{ {
struct pw_properties *props = pw_properties_new(NULL, NULL); struct pw_properties *props = pw_properties_new(NULL, NULL);
const struct spa_dict_item *it; const struct spa_dict_item *it;
if ((res = read_props(m, props, false)) < 0) res = read_props(m, props, false);
return res; if (res >= 0) {
pw_log(level, "%u: props: n_items:%u", o, props->dict.n_items); pw_log(level, "%u: props: n_items:%u", o, props->dict.n_items);
spa_dict_for_each(it, &props->dict) spa_dict_for_each(it, &props->dict)
pw_log(level, " '%s': '%s'", it->key, it->value); pw_log(level, " '%s': '%s'", it->key, it->value);
}
pw_properties_free(props); pw_properties_free(props);
if (res < 0)
return res;
break; break;
} }
case TAG_VOLUME: case TAG_VOLUME: