[pango/asan-fixes: 3/4] tests: Fix memory leaks




commit cca04f5edcbe6253dbcda922bd90b11f7746f050
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Sep 12 13:47:12 2020 -0400

    tests: Fix memory leaks
    
    These were showing up as errors from lsan.

 tests/test-break.c   | 2 +-
 tests/test-itemize.c | 2 +-
 tests/test-layout.c  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/tests/test-break.c b/tests/test-break.c
index db944fbb..0773e5d2 100644
--- a/tests/test-break.c
+++ b/tests/test-break.c
@@ -294,9 +294,9 @@ test_break (gconstpointer d)
       g_test_fail ();
 
       g_strfreev (lines);
-      g_free (diff);
     }
 
+  g_free (diff);
   g_string_free (dump, TRUE);
   g_free (expected_file);
 }
diff --git a/tests/test-itemize.c b/tests/test-itemize.c
index cd145e40..b22f3c2f 100644
--- a/tests/test-itemize.c
+++ b/tests/test-itemize.c
@@ -277,9 +277,9 @@ test_itemize (gconstpointer d)
       g_test_fail ();
 
       g_strfreev (lines);
-      g_free (diff);
     }
 
+  g_free (diff);
   g_string_free (dump, TRUE);
   g_free (expected_file);
 }
diff --git a/tests/test-layout.c b/tests/test-layout.c
index 2cbdc042..5362d6fc 100644
--- a/tests/test-layout.c
+++ b/tests/test-layout.c
@@ -347,9 +347,9 @@ test_layout (gconstpointer d)
 
       g_test_fail ();
       g_strfreev (lines);
-      g_free (diff);
     }
 
+  g_free (diff);
   g_string_free (dump, TRUE);
   g_free (expected_file);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]