From: Sejun Park Date: Thu, 14 Nov 2024 02:10:07 +0000 (+0900) Subject: add code to handle the case where engine id is a null ptr X-Git-Tag: accepted/tizen/unified/20241115.152451^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F320380%2F1;p=platform%2Fcore%2Fuifw%2Fvoice-control.git add code to handle the case where engine id is a null ptr Change-Id: If1544b1d85ff47cdddb6740b6cb413aa2e6435cc --- diff --git a/common/VoiceControlConfig.cpp b/common/VoiceControlConfig.cpp index 9f754b2..e737792 100644 --- a/common/VoiceControlConfig.cpp +++ b/common/VoiceControlConfig.cpp @@ -60,10 +60,15 @@ void VoiceControlConfig::setEngineId(const std::string engineId) } free(mConfig->engine_id); + mConfig->engine_id = nullptr; if (engineId.empty()) { mConfig->engine_id = nullptr; } else { mConfig->engine_id = strdup(engineId.c_str()); + if (mConfig->engine_id == nullptr) { + SLOG(LOG_ERROR, TAG_VCCONFIG, "[ERROR] Memory allocation failed"); + return; + } } SLOG(LOG_ERROR, TAG_VCCONFIG, "Set Engine ID : %s", mConfig->engine_id); } diff --git a/packaging/voice-control.spec b/packaging/voice-control.spec index b6c20b8..9f190e6 100644 --- a/packaging/voice-control.spec +++ b/packaging/voice-control.spec @@ -1,6 +1,6 @@ Name: voice-control Summary: Voice control client library and daemon -Version: 1.90.5 +Version: 1.90.6 Release: 1 Group: Graphics & UI Framework/Voice Framework License: Apache-2.0