From eb7ba645af8bc8332dcd5a73f682d46e8642a2ce Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Fri, 18 Nov 2016 10:32:59 -0500 Subject: [PATCH] [ASAN] tests: Fix some memleaks in libarchive importer Caught by `-fsanitize=address`. Closes: #587 Approved by: jlebon --- tests/test-libarchive-import.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test-libarchive-import.c b/tests/test-libarchive-import.c index ad2e4c94..05c5568d 100644 --- a/tests/test-libarchive-import.c +++ b/tests/test-libarchive-import.c @@ -468,6 +468,8 @@ entry_pathname_test_helper (gconstpointer data, gboolean on) goto out; } + archive_read_free (a); + ostree_repo_commit_modifier_unref (modifier); out: g_assert_no_error (error); } @@ -534,6 +536,7 @@ test_libarchive_selinux (gconstpointer data) g_assert_cmpstr (buf, ==, "system_u:object_r:etc_t:s0"); out: + archive_read_free (a); if (modifier) ostree_repo_commit_modifier_unref (modifier); g_assert_no_error (error); @@ -562,5 +565,6 @@ int main (int argc, char **argv) if (td.tmpd && g_getenv ("TEST_SKIP_CLEANUP") == NULL) (void) glnx_shutil_rm_rf_at (AT_FDCWD, td.tmpd, NULL, NULL); + g_free (td.tmpd); return r; }