projects
/
platform
/
core
/
api
/
system-info.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8b0509d
)
Fix for memory leak
22/112522/1
author
pr.jung
<pr.jung@samsung.com>
Wed, 1 Feb 2017 08:37:56 +0000
(17:37 +0900)
committer
pr.jung
<pr.jung@samsung.com>
Wed, 1 Feb 2017 08:40:15 +0000
(17:40 +0900)
- gdbm_fetch returns a d_data and the actual value is in d_data.dptr
- Memory allocated to d_data.dptr needs to be freed
Change-Id: I774f2b16bbfbeb1cc500976aa266143aa56d5dbb
Signed-off-by: pr.jung <pr.jung@samsung.com>
src/system_info.c
patch
|
blob
|
history
diff --git
a/src/system_info.c
b/src/system_info.c
index
a697eca
..
b819c5c
100644
(file)
--- a/
src/system_info.c
+++ b/
src/system_info.c
@@
-138,6
+138,7
@@
static int db_get_value(enum tag_type tag, const char *key,
}
snprintf(value, len, "%s", d_data.dptr);
+ free(d_data.dptr);
ret = SYSTEM_INFO_ERROR_NONE;
g_hash_table_insert(hashtable, strdup(key_internal), strdup(value));