[gnome-control-center] tests: free TzInfo
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
 
- To: commits-list gnome org
 
- Cc: 
 
- Subject: [gnome-control-center] tests: free TzInfo
 
- Date: Fri, 24 Aug 2018 15:51:10 +0000 (UTC)
 
commit b8972e885c73c337de42e6f0434e775bf6edb552
Author: RyuzakiKK <aasonykk gmail com>
Date:   Thu Aug 23 22:01:21 2018 +0200
    tests: free TzInfo
    
    The timezone information is allocated with `tz_info_from_location` but
    never deallocated.
    LeakSanitizer complains about this memory leak.
    
    ```
    Direct leak of 13568 byte(s) in 424 object(s) allocated from:
    /build/gcc/src/gcc/libsanitizer/asan/asan_malloc_linux.cc:95
        #1 0x7f63899bab21 in g_malloc0 (/usr/lib/libglib-2.0.so.0+0x51b21)
    ../tests/datetime/test-timezone-gfx.c:30
        #3 0x7f63899dc76a  (/usr/lib/libglib-2.0.so.0+0x7376a)
    ```
 tests/datetime/test-timezone-gfx.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/tests/datetime/test-timezone-gfx.c b/tests/datetime/test-timezone-gfx.c
index 22619c30c..1c25d4886 100644
--- a/tests/datetime/test-timezone-gfx.c
+++ b/tests/datetime/test-timezone-gfx.c
@@ -29,6 +29,7 @@ test_timezone_gfx (gconstpointer data)
       location = locs->pdata[i];
       info = tz_info_from_location (location);
       selected_offset = tz_location_get_utc_offset (location) / (60.0 * 60.0) + (info->daylight ? -1.0 : 
0.0);
+      tz_info_free (info);
 
       filename = g_strdup_printf ("timezone_%s.png", g_ascii_formatd (buf, sizeof (buf), "%g", 
selected_offset));
       path = g_build_filename (pixmap_dir, filename, NULL);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]