From: Colin Walters Date: Fri, 8 Dec 2017 19:39:01 +0000 (-0500) Subject: lib/commit: Fix memleak in bare-user devino hit path X-Git-Tag: archive/raspbian/2022.1-3+rpi1~1^2~4^2~28^2~26 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=6d8aaf629c904d6b0e1c2a06641829590eeebf45;p=ostree.git lib/commit: Fix memleak in bare-user devino hit path I noticed this while chasing an entirely different issue: https://github.com/projectatomic/rpm-ostree/pull/1139 Closes: #1370 Approved by: jlebon --- diff --git a/src/libostree/ostree-repo-commit.c b/src/libostree/ostree-repo-commit.c index 107f2ecd..ca384fb8 100644 --- a/src/libostree/ostree-repo-commit.c +++ b/src/libostree/ostree-repo-commit.c @@ -3004,12 +3004,13 @@ write_content_to_mtree_internal (OstreeRepo *self, * there. */ g_autoptr(GVariant) source_xattrs = NULL; + g_autoptr(GFileInfo) source_child_info = NULL; if (loose_checksum && self->mode == OSTREE_REPO_MODE_BARE_USER) { - child_info = NULL; - if (!ostree_repo_load_file (self, loose_checksum, NULL, &child_info, &source_xattrs, + if (!ostree_repo_load_file (self, loose_checksum, NULL, &source_child_info, &source_xattrs, cancellable, error)) return FALSE; + child_info = source_child_info; } /* Call the filter */