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:
eccb1ad
)
DSXkb: strdup a result of getenv
02/241702/1
author
jeon
<jhyuni.kang@samsung.com>
Fri, 31 Jul 2020 05:57:03 +0000
(14:57 +0900)
committer
Sung-Jin Park
<sj76.park@samsung.com>
Thu, 20 Aug 2020 10:05:02 +0000
(19:05 +0900)
Change-Id: I5f5ca2abd31f853aa8e50537e130a123048786af
src/DSXkb/DSXkb.cpp
patch
|
blob
|
history
diff --git
a/src/DSXkb/DSXkb.cpp
b/src/DSXkb/DSXkb.cpp
index
8a80669
..
cda12b9
100644
(file)
--- a/
src/DSXkb/DSXkb.cpp
+++ b/
src/DSXkb/DSXkb.cpp
@@
-229,14
+229,18
@@
int DSXkbPrivate::getKeycode(std::string keyname)
int DSXkbPrivate::__getKeymapFd(off_t size)
{
int fd = 0, blen = 0, len = 0;
- char *path;
+ char *path
= nullptr, *env = nullptr
;
char tmp[PATH_MAX] = {0, };
long flags;
mode_t old_umask;
blen = sizeof(tmp) - 20;
- path = getenv("XDG_RUNTIME_DIR");
+ env = getenv("XDG_RUNTIME_DIR");
+ if (env)
+ {
+ path = strdup(env);
+ }
if (!path) return -1;
len = strlen(path) + 19;