From: Philip Withnall Date: Tue, 14 Nov 2017 16:15:34 +0000 (+0000) Subject: lib/repo: Fix a memory leak of options in ostree_repo_create() X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~29^2~24 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=4a58364cfaccc231f7f1908f04f9e92ebf9307a1;p=ostree.git lib/repo: Fix a memory leak of options in ostree_repo_create() Signed-off-by: Philip Withnall Closes: #1341 Approved by: dbnicholson --- diff --git a/src/libostree/ostree-repo.c b/src/libostree/ostree-repo.c index 7f2929b7..22214056 100644 --- a/src/libostree/ostree-repo.c +++ b/src/libostree/ostree-repo.c @@ -1918,8 +1918,9 @@ ostree_repo_create (OstreeRepo *self, g_variant_new_variant (g_variant_new_string (self->collection_id))); glnx_autofd int repo_dir_fd = -1; + g_autoptr(GVariant) options = g_variant_ref_sink (g_variant_builder_end (builder)); if (!repo_create_at_internal (AT_FDCWD, repopath, mode, - g_variant_builder_end (builder), + options, &repo_dir_fd, cancellable, error)) return FALSE;