From 762a52309859702b8382e01a32384c975982688d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Barnab=C3=A1s=20P=C5=91cze?= Date: Tue, 15 Feb 2022 10:00:04 +0100 Subject: [PATCH] pipewire: conf: initialize return value In some cases it is possible for `pw_context_conf_section_for_each()` to not set `res` at all, which leads to an indeterminate value being returned. Fix that by setting `res` to 0 initially. --- src/pipewire/conf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipewire/conf.c b/src/pipewire/conf.c index 2d82c44ca..33aa87c90 100644 --- a/src/pipewire/conf.c +++ b/src/pipewire/conf.c @@ -836,7 +836,7 @@ int pw_context_conf_section_for_each(struct pw_context *context, const char *sec struct pw_properties *conf = context->conf; const char *path = NULL; const struct spa_dict_item *it; - int res; + int res = 0; spa_dict_for_each(it, &conf->dict) { if (spa_strendswith(it->key, "config.path")) {