From: Hwankyu Jhun Date: Tue, 27 Sep 2022 02:08:15 +0000 (+0000) Subject: Fix static analysis issue X-Git-Tag: accepted/tizen/unified/20220928.144434~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd0652d51ffc7002a7d159ec06b5ca6e41191ea7;p=platform%2Fcore%2Fappfw%2Faul-1.git Fix static analysis issue This patch fixes 'use after free' case. The bundle instance is moved using std::move(). Change-Id: I3e00efdb42038c1a324e3a687678829e6a5b3eaa Signed-off-by: Hwankyu Jhun --- diff --git a/src/app_com.cc b/src/app_com.cc index 6b78bf7..307534b 100644 --- a/src/app_com.cc +++ b/src/app_com.cc @@ -326,8 +326,8 @@ extern "C" API int aul_app_com_send(const char* endpoint, bundle* envelope) { .With(std::move(b)) .SendSimply(); if (type != BUNDLE_TYPE_NONE) { - b.Delete(AUL_K_COM_ENDPOINT); - b.Add(AUL_K_COM_ENDPOINT, com_endpoint); + bundle_del(envelope, AUL_K_COM_ENDPOINT); + bundle_add_str(envelope, AUL_K_COM_ENDPOINT, com_endpoint.c_str()); } return ret;