summaryrefslogtreecommitdiff
path: root/src/ostree/ot-builtin-export.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2016-12-02 13:34:32 -0500
committerAtomic Bot <atomic-devel@projectatomic.io>2016-12-05 15:20:56 +0000
commit7bb0ff46a438977297329ad6949faa4fae06f543 (patch)
treef2e516baaca3d8db02c6d889375ed02153ec53c7 /src/ostree/ot-builtin-export.c
parentc733e21a84f788cb4c9ac4e723743cedb898b345 (diff)
downloadostree-7bb0ff46a438977297329ad6949faa4fae06f543.tar.gz
Define and use cleanup helpers for libarchive
This should fix some of the ASAN leaks around libarchive usage, and is generally better. Closes: #609 Approved by: jlebon
Diffstat (limited to 'src/ostree/ot-builtin-export.c')
-rw-r--r--src/ostree/ot-builtin-export.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/ostree/ot-builtin-export.c b/src/ostree/ot-builtin-export.c
index db4dbc31..b0bb40fa 100644
--- a/src/ostree/ot-builtin-export.c
+++ b/src/ostree/ot-builtin-export.c
@@ -24,6 +24,7 @@
#include "ot-builtins.h"
#include "ostree.h"
#include "ostree-repo-file.h"
+#include "ostree-libarchive-private.h"
#include "otutil.h"
#ifdef HAVE_LIBARCHIVE
@@ -67,7 +68,7 @@ ostree_builtin_export (int argc, char **argv, GCancellable *cancellable, GError
g_autoptr(GFile) subtree = NULL;
g_autofree char *commit = NULL;
g_autoptr(GVariant) commit_data = NULL;
- struct archive *a = NULL;
+ ot_cleanup_write_archive struct archive *a = NULL;
OstreeRepoExportArchiveOptions opts = { 0, };
context = g_option_context_new ("COMMIT - Stream COMMIT to stdout in tar format");
@@ -154,10 +155,6 @@ ostree_builtin_export (int argc, char **argv, GCancellable *cancellable, GError
ret = TRUE;
out:
-#ifdef HAVE_LIBARCHIVE
- if (a)
- archive_write_free (a);
-#endif
if (context)
g_option_context_free (context);
return ret;