projects
/
platform
/
upstream
/
connman.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4140b53
)
timezone: Do not access already released memory
author
Jukka Rissanen
<jukka.rissanen@linux.intel.com>
Wed, 31 Aug 2011 08:42:44 +0000
(11:42 +0300)
committer
Samuel Ortiz
<sameo@linux.intel.com>
Mon, 12 Sep 2011 09:40:48 +0000
(11:40 +0200)
closedir() releases the filename but we were accessing it later.
src/timezone.c
patch
|
blob
|
history
diff --git
a/src/timezone.c
b/src/timezone.c
index
08f904f
..
1234622
100644
(file)
--- a/
src/timezone.c
+++ b/
src/timezone.c
@@
-185,9
+185,10
@@
static char *find_origin(void *src_map, struct stat *src_st,
subpath, d->d_name);
if (compare_file(src_map, src_st, pathname) == 0) {
- closedir(dir);
- return g_strdup_printf("%s/%s",
+ str = g_strdup_printf("%s/%s",
subpath, d->d_name);
+ closedir(dir);
+ return str;
}
break;
case DT_DIR: