From 6d7cd80d77ed35efbe168f627dda021a5d8dd766 Mon Sep 17 00:00:00 2001
From: Kwangkyu Park <kk48.park@samsung.com>
Date: Thu, 9 Feb 2023 16:29:10 +0900
Subject: [PATCH] Fix an issue that a free memory is accessed

In error state, request thread join is not executed. And,
Camera3Device's mId can be accessed from String& after being freed with
CLOGE().

This fix will address by changing reference type to normal variable.

Bug: 268437033
Change-Id: Iad3fcd0fbbaf1e18a2b95093aba08015a933374c
---
 services/camera/libcameraservice/device3/Camera3Device.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/services/camera/libcameraservice/device3/Camera3Device.h b/services/camera/libcameraservice/device3/Camera3Device.h
index e6073a94d4..5187a96f59 100644
--- a/services/camera/libcameraservice/device3/Camera3Device.h
+++ b/services/camera/libcameraservice/device3/Camera3Device.h
@@ -1010,7 +1010,7 @@ class Camera3Device :
 
         wp<NotificationListener> mListener;
 
-        const String8&     mId;       // The camera ID
+        const String8      mId;       // The camera ID
         int                mStatusId; // The RequestThread's component ID for
                                       // status tracking
 
