projects
/
platform
/
core
/
uifw
/
multi-assistant-service.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6b63f09
)
Fix defects detected by coverity tool
80/319080/2
author
dyamy-lee
<dyamy.lee@samsung.com>
Tue, 4 Feb 2025 04:37:58 +0000
(13:37 +0900)
committer
dyamy-lee
<dyamy.lee@samsung.com>
Tue, 4 Feb 2025 05:05:58 +0000
(14:05 +0900)
To pervent memory leak, checking and freeing the variable before using strdup
Change-Id: I2c98f1f8dbedc17d8e9731b668ea3cd9ee021b2d
src/service_config.cpp
patch
|
blob
|
history
diff --git
a/src/service_config.cpp
b/src/service_config.cpp
index 9741ccd7b6aa2675b1562a14bd7f4066e1da13c5..3cd38acf610706dd2a92c34e58459a4fc8e1dd0c 100644
(file)
--- a/
src/service_config.cpp
+++ b/
src/service_config.cpp
@@
-124,6
+124,10
@@
int CServiceConfig::parse_assistant_info(service_config_assistant_info_cb callba
} else if (cur->name && 0 == xmlStrcmp(cur->name, (const xmlChar*)MA_TAG_ASSISTANT_ICON_PATH)) {
key = xmlNodeGetContent(cur);
if (key) {
+ if (temp.icon_path) {
+ free((void*)temp.icon_path);
+ temp.icon_path = NULL;
+ }
temp.icon_path = strdup((const char*)key);
MAS_LOGI("Icon Path : %s", key);
xmlFree(key);