From 44ff13c369f226942744caaa5e9f02801c5fb1f7 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 11 Jan 2023 16:39:52 -0500 Subject: [PATCH] Stop holding a reference into a temporary. This was drive-by fixed on tip by https://github.com/project-chip/connectedhomeip/pull/23827 but we should fix on 1.0 too. Fixes https://github.com/project-chip/connectedhomeip/issues/24367 --- src/controller/AutoCommissioner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/controller/AutoCommissioner.cpp b/src/controller/AutoCommissioner.cpp index a51f3573f85786..d11fc9e676932d 100644 --- a/src/controller/AutoCommissioner.cpp +++ b/src/controller/AutoCommissioner.cpp @@ -100,7 +100,7 @@ CHIP_ERROR AutoCommissioner::SetCommissioningParameters(const CommissioningParam if (params.GetCountryCode().HasValue()) { - auto & code = params.GetCountryCode().Value(); + auto code = params.GetCountryCode().Value(); MutableCharSpan copiedCode(mCountryCode); if (CopyCharSpanToMutableCharSpan(code, copiedCode) == CHIP_NO_ERROR) {