Merge lp:~dshea/timezonemap/memory-problems into lp:timezonemap
Status: | Needs review |
---|---|
Proposed branch: | lp:~dshea/timezonemap/memory-problems |
Merge into: | lp:timezonemap |
Diff against target: |
155 lines (+47/-20) 3 files modified
debian/control (+2/-2) src/cc-timezone-map.c (+35/-4) src/tz.c (+10/-14) |
To merge this branch: | bzr merge lp:~dshea/timezonemap/memory-problems |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Timezone Map Team | Pending | ||
Review via email: mp+295635@code.launchpad.net |
Description of the change
This fixes a memory leak and an access of freed memory, and works around a call to setenv which is not thread-safe. tz_location_
Unmerged revisions
- 62. By David Shea
-
Fix the calculation of time zone offsets.
g_get_real_time returns microseconds, not milliseconds.
- 61. By David Shea
-
Do not use tz_location_
get_utc_ offset The function in tz.c to fetch the timezone offset for a given location
sets the TZ environment variable which, besides being potentially
surprising to the rest of the process, is not thread-safe. Instead,
skip the function entirely and use the glib functions for querying time
zone data.Increase the required glib version to 2.26 for the GTimeZone functions.
- 60. By David Shea
-
Fix an invalid memory access
When truncating the list for the distance-based location search, do not
attempt to read the rest of the list after it has been freed. - 59. By David Shea
-
Fix memory leaks in tz.c
Use a stack-allocated block for the user_data struct passed to
parse_cities15000, since the struct itself is not needed after
parse_file, and no one can forget to free it if it's not dynamically
allocated the first place.Use const strings in tz_data_file_get so that the return value does not
need to be duplicated and freed.