projects
/
platform
/
core
/
uifw
/
libds.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
49059dd
)
DSDebug: null check after getenv and strdup
20/242320/1
author
jeon
<jhyuni.kang@samsung.com>
Tue, 25 Aug 2020 01:47:27 +0000
(10:47 +0900)
committer
Sung-Jin Park
<sj76.park@samsung.com>
Tue, 25 Aug 2020 12:37:37 +0000
(21:37 +0900)
Change-Id: I9f82aa12b71c95b930958be6d30d04d1e9bfa232
src/DSDebug/DSDebugLog.cpp
patch
|
blob
|
history
diff --git
a/src/DSDebug/DSDebugLog.cpp
b/src/DSDebug/DSDebugLog.cpp
index
3966335
..
bd579df
100644
(file)
--- a/
src/DSDebug/DSDebugLog.cpp
+++ b/
src/DSDebug/DSDebugLog.cpp
@@
-33,18
+33,20
@@
namespace display_server
{
-DSDebugLog::DSDebugLog() : mLogLevel(LOG_LEVEL_DEBUG)
+DSDebugLog::DSDebugLog() : mLogLevel(LOG_LEVEL_DEBUG)
, __enableDlog(false)
{
char *tmp = getenv("DSLOG_DLOG_ENABLE");
+ if (!tmp) return;
+
char *env = strdup(tmp);
+ if (!env) return;
+
int value = atoi(env);
free(env);
if (value == 1)
__enableDlog = true;
- else
- __enableDlog = false;
}
DSDebugLog::~DSDebugLog()