From 8dbb104cdcfaadad8a826eb76fec5f7058c5beb4 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 8 Sep 2016 10:29:10 -0400 Subject: [PATCH] delta: Add missing `goto out` for failure to mmap() This was hit in practice when generating a delta for a flatpak app on ARM it looks like. Closes: #497 Approved by: alexlarsson --- src/libostree/ostree-repo-static-delta-compilation.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libostree/ostree-repo-static-delta-compilation.c b/src/libostree/ostree-repo-static-delta-compilation.c index 188f467d..15b1df8d 100644 --- a/src/libostree/ostree-repo-static-delta-compilation.c +++ b/src/libostree/ostree-repo-static-delta-compilation.c @@ -483,6 +483,8 @@ get_unpacked_unlinked_content (OstreeRepo *repo, goto out; { GMappedFile *mfile = g_mapped_file_new_from_fd (fd, FALSE, error); + if (!mfile) + goto out; ret_content = g_mapped_file_get_bytes (mfile); g_mapped_file_unref (mfile); }